forked from apache/incubator-toree
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
108 lines (86 loc) · 3.91 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License
#
# This Dockerfile is for MyBinder support
FROM andrewosh/binder-base
USER root
# for declarativewidgets
RUN curl -sL https://deb.nodesource.com/setup_0.12 | bash - && \
apt-get install -y nodejs npm && \
npm install -g bower
# for pyspark demos
ENV APACHE_SPARK_VERSION 2.0.0
RUN apt-get -y update && \
apt-get -y install software-properties-common
RUN \
echo "===> add webupd8 repository..." && \
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee /etc/apt/sources.list.d/webupd8team-java.list && \
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee -a /etc/apt/sources.list.d/webupd8team-java.list && \
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886 && \
apt-get update
RUN echo "===> install Java" && \
echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \
echo debconf shared/accepted-oracle-license-v1-1 seen true | debconf-set-selections && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --force-yes oracle-java8-installer oracle-java8-set-default && \
apt-get clean && \
update-java-alternatives -s java-8-oracle
RUN cd /tmp && \
wget -q http://apache.claz.org/spark/spark-${APACHE_SPARK_VERSION}/spark-${APACHE_SPARK_VERSION}-bin-hadoop2.6.tgz && \
tar xzf spark-${APACHE_SPARK_VERSION}-bin-hadoop2.6.tgz -C /usr/local && \
rm spark-${APACHE_SPARK_VERSION}-bin-hadoop2.6.tgz
RUN cd /usr/local && ln -s spark-${APACHE_SPARK_VERSION}-bin-hadoop2.6 spark
# R support
RUN apt-get update && \
apt-get install -y --no-install-recommends \
fonts-dejavu \
gfortran \
gcc && apt-get clean && \
rm -rf /var/lib/apt/lists/*
ENV SPARK_HOME /usr/local/spark
ENV PYTHONPATH $SPARK_HOME/python:$SPARK_HOME/python/lib/py4j-0.10.1-src.zip
ENV PYSPARK_PYTHON /home/main/anaconda2/envs/python3/bin/python
ENV R_LIBS_USER $SPARK_HOME/R/lib
USER main
ENV DASHBOARDS_VERSION ==0.4.1
ENV DASHBOARDS_BUNDLERS_VERSION ==0.2.2
ENV TOREE_VERSION >=0.1.0.dev0, <=0.1.0
# get to the latest jupyter release and necessary libraries
RUN conda install -y jupyter seaborn futures && \
bash -c "source activate python3 && \
conda install seaborn"
# R packages
RUN conda config --add channels r && \
conda install --quiet --yes \
'r-base=3.2*' \
'r-ggplot2=1.0*' \
'r-rcurl=1.95*' && conda clean -tipsy
ENV DECL_WIDGETS_VERSION 0.4.3
# install incubator extensions
RUN pip install jupyter_dashboards==0.4.1 \
jupyter_declarativewidgets==$DECL_WIDGETS_VERSION \
jupyter_dashboards_bundlers==0.2.2
RUN jupyter dashboards install --user --symlink && \
jupyter declarativewidgets install --user --symlink && \
jupyter dashboards activate && \
jupyter declarativewidgets activate && \
jupyter dashboards_bundlers activate
# install kernel-side incubator extensions for python3 environment too
RUN bash -c "source activate python3 && pip install jupyter_declarativewidgets==$DECL_WIDGETS_VERSION"
# install Toree
RUN pip install 'toree>=0.1.0.dev0, <=0.1.0'
RUN jupyter toree install --user
# include nice intro notebook
COPY index.ipynb $HOME/notebooks/