forked from mingfang/docker-ipython
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
120 lines (101 loc) · 3.9 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
109
110
111
112
113
114
115
116
117
118
119
120
FROM ubuntu:14.04
RUN echo 'deb http://archive.ubuntu.com/ubuntu trusty main universe' > /etc/apt/sources.list && \
echo 'deb http://archive.ubuntu.com/ubuntu trusty-updates universe' >> /etc/apt/sources.list
# echo 'deb http://archive.ubuntu.com/ubuntu trusty-security universe' >> /etc/apt/sources.list && \
# echo 'deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty main' >> /etc/apt/sources.list && \
# echo 'deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty' main >> /etc/apt/sources.list
#Prevent daemon start during install
RUN dpkg-divert --local --rename --add /sbin/initctl && ln -s /bin/true /sbin/initctl -f
RUN apt-get update
#Supervisord
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y supervisor && mkdir -p /var/log/supervisor
#SSHD
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y openssh-server && mkdir /var/run/sshd && \
echo 'root:root' |chpasswd
#Utilities
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y vim less net-tools inetutils-ping curl git telnet nmap socat dnsutils netcat
#Required by Python packages
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential python-dev python-pip liblapack-dev libatlas-dev gfortran libfreetype6 libfreetype6-dev libpng12-dev python-lxml libyaml-dev g++ libffi-dev pkg-config
#0MQ
RUN cd /tmp && \
wget http://download.zeromq.org/zeromq-4.0.3.tar.gz && \
tar xvfz zeromq-4.0.3.tar.gz && \
cd zeromq-4.0.3 && \
./configure && \
make install && \
ldconfig
RUN export PIP_DEFAULT_TIMEOUT=600
#Upgrade pip
RUN pip install -U setuptools
RUN pip install -U pip
#matplotlib needs latest distribute
RUN pip install -U distribute
#IPython
RUN pip install ipython
#NumPy is required for Numba
RUN pip install numpy
#Pandas
RUN pip install pandas
#Optional
RUN ln -s /usr/local/opt/freetype/include/freetype2 /usr/local/include/freetype
RUN pip install cython
RUN pip install jinja2 pyzmq tornado
RUN pip install numexpr bottleneck scipy pygments
RUN pip install matplotlib sympy pymc
RUN pip install patsy
RUN pip install statsmodels
RUN pip install beautifulsoup4 html5lib
#Pattern
RUN pip install --allow-external pattern pattern
#NLTK
RUN pip install pyyaml nltk
#Networkx
RUN pip install networkx
#LLVM and Numba
#RUN apt-get install -y llvm-3.3
RUN cd /tmp && \
wget http://llvm.org/releases/3.2/llvm-3.2.src.tar.gz && \
tar zxvf llvm-3.2.src.tar.gz && \
cd llvm-3.2.src && \
./configure --enable-optimized && \
REQUIRES_RTTI=1 make install
#RUN pip install versioneer
#RUN versioneer-installer
RUN pip install llvmpy==0.11.2 && \
pip install llvmmath && \
pip install numba
#Biopython
RUN pip install biopython
#Bokeh
#RUN pip install requests bokeh
#Install R 3+
RUN echo 'deb http://cran.rstudio.com/bin/linux/ubuntu trusty/' > /etc/apt/sources.list.d/r.list
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9
RUN apt-get update
RUN apt-get install -y r-base
#Rmagic
RUN pip install rpy2
#Vincent
RUN pip install vincent
#Scikit-learn
RUN pip install -U scikit-learn
#Cleanup
RUN apt-get clean
RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
#user ipy
RUN useradd -m ipy -s /bin/bash
RUN echo "ipy:ipython" | chpasswd
RUN adduser ipy sudo
RUN sudo -u ipy mkdir -p /home/ipy/bin /home/ipy/.matplotlib /home/ipy/.ipython /home/ipy/ipynotebooks /home/ipy/.ssh
ENV IPYTHONDIR /home/ipy/.ipython
ENV IPYTHON_PROFILE nbserver
RUN /usr/local/bin/ipython profile create nbserver
# Adding script necessary to start ipython notebook server.
#ADD ./notebooks /home/ipy/ipynotebooks
ADD ./profile_nbserver/ipython_notebook_config.py /home/ipy/.ipython/profile_nbserver/ipython_notebook_config.py
RUN chown ipy:ipy /home/ipy/ -R && chmod 755 /var/run/sshd/
# fix security bug permissions
RUN cd /home/ipy/.ipython/profile_nbserver/ && mv pid pid_ && mv pid_ pid && mv security security_ && mv security_ security
ADD ./conf /etc/supervisor/conf.d
EXPOSE 22 8888 9001
CMD ["/usr/bin/supervisord"]