forked from jupyter/docker-stacks
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
100 lines (84 loc) · 2.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
# Copyright (c) Jupyter Development Team.
FROM jupyter/minimal-notebook
MAINTAINER Jupyter Project <[email protected]>
USER root
# Spark dependencies
ENV APACHE_SPARK_VERSION 1.5.1
RUN apt-get -y update && \
apt-get install -y --no-install-recommends openjdk-7-jre-headless && \
apt-get clean
RUN wget -qO - http://d3kbcqa49mib13.cloudfront.net/spark-${APACHE_SPARK_VERSION}-bin-hadoop2.6.tgz | tar -xz -C /usr/local/
RUN cd /usr/local && ln -s spark-${APACHE_SPARK_VERSION}-bin-hadoop2.6 spark
# Mesos dependencies
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv E56151BF && \
DISTRO=debian && \
CODENAME=wheezy && \
echo "deb http://repos.mesosphere.io/${DISTRO} ${CODENAME} main" > /etc/apt/sources.list.d/mesosphere.list && \
apt-get -y update && \
apt-get --no-install-recommends -y --force-yes install mesos=0.22.1-1.0.debian78 && \
apt-get clean
# Scala Spark kernel (build and cleanup)
RUN cd /tmp && \
echo deb http://dl.bintray.com/sbt/debian / > /etc/apt/sources.list.d/sbt.list && \
apt-get update && \
git clone https://github.com/ibm-et/spark-kernel.git && \
apt-get install -yq --force-yes --no-install-recommends sbt && \
cd spark-kernel && \
sbt compile -Xms1024M \
-Xmx2048M \
-Xss1M \
-XX:+CMSClassUnloadingEnabled \
-XX:MaxPermSize=1024M && \
sbt pack && \
mv kernel/target/pack /opt/sparkkernel && \
chmod +x /opt/sparkkernel && \
rm -rf ~/.ivy2 && \
rm -rf ~/.sbt && \
rm -rf /tmp/spark-kernel && \
apt-get remove -y sbt && \
apt-get clean
# Spark and Mesos pointers
ENV SPARK_HOME /usr/local/spark
ENV R_LIBS_USER $SPARK_HOME/R/lib
ENV PYTHONPATH $SPARK_HOME/python:$SPARK_HOME/python/lib/py4j-0.8.2.1-src.zip
ENV MESOS_NATIVE_LIBRARY /usr/local/lib/libmesos.so
# Install Python 3 packages
RUN conda install --yes \
'ipywidgets=4.0*' \
'pandas=0.16*' \
'matplotlib=1.4*' \
'scipy=0.15*' \
'seaborn=0.6*' \
'scikit-learn=0.16*' \
&& conda clean -yt
# Install Python 2 packages
RUN conda create -p $CONDA_DIR/envs/python2 python=2.7 \
'ipython=4.0*' \
'ipywidgets=4.0*' \
'pandas=0.16*' \
'matplotlib=1.4*' \
'scipy=0.15*' \
'seaborn=0.6*' \
'scikit-learn=0.16*' \
pyzmq \
&& conda clean -yt
# R packages
RUN conda config --add channels r
RUN conda install --yes \
'r-base=3.2*' \
'r-irkernel=0.4*' \
'r-ggplot2=1.0*' \
'r-rcurl=1.95*' && conda clean -yt
# Scala Spark kernel spec
RUN mkdir -p /opt/conda/share/jupyter/kernels/scala
COPY kernel.json /opt/conda/share/jupyter/kernels/scala/
USER root
# Install Python 2 kernel spec globally to avoid permission problems when NB_UID
# switching at runtime.
RUN $CONDA_DIR/envs/python2/bin/python \
$CONDA_DIR/envs/python2/bin/ipython \
kernelspec install-self
# INSTALL KERAS
RUN apt-get install -y libhdf5-dev
RUN conda install --yes keras
RUN conda install --yes plotly