-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
153 lines (145 loc) · 5.12 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
FROM akabe/ocaml:centos7_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 MariaDB.repo /etc/yum.repos.d/MariaDB.repo
RUN sudo yum install -y epel-release && \
sudo yum install -y python34-devel python34-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 yum remove -y python34-devel && \
sudo yum clean all
RUN sudo curl -o /usr/bin/aspcud 'https://raw.githubusercontent.com/avsm/opam-solver-proxy/8f162de1fe89b2e243d89961f376c80fde6de76d/aspcud.docker' && \
sudo chmod 755 /usr/bin/aspcud && \
sudo rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm && \
sudo rpm -ivh http://repo.okay.com.mx/centos/7/x86_64/release/okay-release-1-1.noarch.rpm && \
sudo rpm -ivh http://packages.groonga.org/centos/groonga-release-1.1.0-1.noarch.rpm && \
sudo yum install -y --enablerepo=epel,nux-dextop \
which \
file \
git \
openssl \
m4 \
rsync \
gcc \
gcc-c++ \
zeromq-devel \
libffi-devel \
gmp-devel \
cairo-devel \
plplot-devel \
openssh-clients \
blas-devel \
lapack-devel \
openblas-devel \
gsl-devel \
fftw-devel \
libsvm-devel \
MariaDB-devel \
postgresql-devel \
sqlite-devel \
gmp-devel \
mecab mecab-devel mecab-ipadic \
openssl-devel \
ImageMagick \
ffmpeg \
phantomjs \
&& \
sudo mv /usr/include/openblas/* /usr/include/ && \
sudo ln -sf /usr/lib64/libmysqlclient.so.18.0.0 /usr/lib/libmysqlclient.so && \
sudo ln -sf /usr/lib64/libmysqlclient.so.18.0.0 /usr/lib/libmariadb.so && \
sudo ln -sf /usr/lib64/libopenblas.so.0 /usr/lib/libopenblas.so && \
\
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 yum remove -y which file git openssl m4 rsync gcc gcc-c++ gcc-gfortran && \
sudo yum clean all && \
sudo rm -f /usr/bin/aspcud
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=*" ]