-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
155 lines (147 loc) · 4.94 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
FROM akabe/ocaml:debian8_ocaml4.05.0
ENV PATH $PATH:/home/opam/.local/bin
ENV TENSORFLOW_VERSION 1.1.0
ENV LD_LIBRARY_PATH /usr/lib:$LD_LIBRARY_PATH
ENV LIBRARY_PATH /usr/lib:$LIBRARY_PATH
# For phantomjs:
ENV QT_QPA_PLATFORM offscreen
ADD ocaml-jupyter-datascience-extra.list /etc/apt/sources.list.d/ocaml-jupyter-datascience-extra.list
RUN sudo apt-get install -y python3 python3-dev python3-pip && \
sudo pip3 install --upgrade pip && \
pip3 install --user --no-cache-dir 'setuptools>=18.5' 'six>=1.9.0' jupyter jupyter_contrib_nbextensions && \
jupyter contrib nbextension install --user && \
mkdir -p /home/opam/.jupyter && \
sudo apt-get purge -y python3-dev && \
sudo apt-get autoremove -y && \
sudo apt-get autoclean
RUN sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db && \
sudo apt-get update && \
sudo apt-get upgrade -y && \
sudo apt-get install -y \
m4 \
git \
xz-utils \
openssl \
rsync \
gcc \
gfortran \
aspcud \
pkg-config \
ssh \
libzmq3-dev \
libffi-dev \
libgmp-dev \
libcairo2-dev \
libplplot-dev plplot12-driver-cairo \
libffi-dev \
libgsl0-dev \
libfftw3-dev \
libsvm-dev \
libcairo2-dev \
libmariadb-dev \
libpq-dev \
libsqlite3-dev \
libgmp-dev \
mecab libmecab-dev mecab-ipadic-utf8 \
imagemagick \
ffmpeg \
&& \
sudo apt-get install -t jessie-backports -y \
libblas3 libblas-dev \
liblapack3 liblapack-dev \
libopenblas-dev \
liblapacke liblapacke-dev \
phantomjs \
&& \
sudo ln -sf /usr/lib/x86_64-linux-gnu/libmysqlclient.so.20 /usr/lib/libmysqlclient.so && \
sudo ln -sf /usr/lib/x86_64-linux-gnu/libshp.so.2 /usr/lib/libshp.so && \
sudo ln -sf /etc/fonts /usr/lib/x86_64-linux-gnu/fonts && \
\
curl -L https://github.com/neologd/mecab-ipadic-neologd/archive/master.tar.gz \
-o /tmp/mecab-ipadic-neologd-master.tar.gz && \
tar zxf /tmp/mecab-ipadic-neologd-master.tar.gz -C /tmp && \
( cd /tmp/mecab-ipadic-neologd-master && ./bin/install-mecab-ipadic-neologd -n -y ) && \
rm -rf /tmp/mecab-ipadic-neologd-master.tar.gz /tmp/mecab-ipadic-neologd-master && \
\
eval $(opam config env) && \
\
opam update && \
opam upgrade -y && \
opam install -y \
batteries \
'core>=v0.9.0' \
'async>=v0.9.0' \
'lwt>=3.0.0' \
lwt_ssl \
'cstruct>=3.1.1' 'ppx_cstruct>=3.1.1' 'tls>=0.8.0' \
cohttp-async \
'cohttp-lwt-unix>=1.0.0' \
cohttp-top \
'merlin>=3.0.0' jupyter jupyter-archimedes \
lacaml \
slap \
lbfgs \
ocephes \
oml \
gsl \
gpr \
fftw3 \
'dolog>=3.0' 'eigen>=0.0.3' 'oasis>=0.4.10' 'owl>=0.2.6' \
mysql \
'mariadb>=0.8.1' \
postgresql \
sqlite3 \
lambdasoup \
csv csv-lwt \
camomile \
mecab \
ppx_sexp_conv \
'ppx_deriving_yojson>=3.1' \
ppx_regexp && \
\
: install kernel && \
jupyter kernelspec install --user --name ocaml-jupyter "$(opam config var share)/jupyter" && \
\
: install libsvm && \
curl -L https://bitbucket.org/ogu/libsvm-ocaml/downloads/libsvm-ocaml-0.9.3.tar.gz \
-o /tmp/libsvm-ocaml-0.9.3.tar.gz && \
tar zxf /tmp/libsvm-ocaml-0.9.3.tar.gz -C /tmp && \
( \
cd /tmp/libsvm-ocaml-0.9.3 && \
oasis setup && \
./configure --prefix=$(opam config var prefix) && \
make && \
make install \
) && \
rm -rf /tmp/libsvm-ocaml-0.9.3.tar.gz /tmp/libsvm-ocaml-0.9.3 && \
\
: install tensorflow && \
sudo curl -L "https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-x86_64-$TENSORFLOW_VERSION.tar.gz" | sudo tar xz -C /usr && \
curl -L "https://github.com/LaurentMazare/tensorflow-ocaml/archive/0.0.10.1.tar.gz" \
-o /tmp/tensorflow-ocaml-0.0.10.1.tar.gz && \
tar zxf /tmp/tensorflow-ocaml-0.0.10.1.tar.gz -C /tmp && \
( \
cd /tmp/tensorflow-ocaml-0.0.10.1 && \
sed -i 's/(no_dynlink)//' src/wrapper/jbuild && \
sed -i 's/(modes (native))//' src/wrapper/jbuild \
) && \
opam pin add -y /tmp/tensorflow-ocaml-0.0.10.1 && \
rm -rf /tmp/tensorflow-ocaml-0.0.10.1.tar.gz /tmp/tensorflow-ocaml-0.0.10.1 && \
\
rm -rf $HOME/.opam/archives \
$HOME/.opam/repo/default/archives \
$HOME/.opam/$OCAML_VERSION/man \
$HOME/.opam/$OCAML_VERSION/build && \
\
sudo apt-get purge -y m4 git xz-utils openssl rsync gcc gfortran aspcud pkg-config && \
sudo apt-get autoremove -y && \
sudo apt-get autoclean
VOLUME /notebooks
VOLUME /home/opam/.jupyter
WORKDIR /notebooks
COPY entrypoint.sh /
COPY .ocamlinit /home/opam/.ocamlinit
COPY .jupyter /home/opam/.jupyter
EXPOSE 8888
ENTRYPOINT [ "/entrypoint.sh" ]
CMD [ "jupyter", "notebook", "--no-browser", "--ip=*" ]