-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
314 lines (249 loc) · 8.16 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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
FROM nvidia/cuda:9.2-cudnn7-runtime-ubuntu16.04
MAINTAINER Samir Jabari <[email protected]>
USER root
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install python-software-properties
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install software-properties-common
RUN add-apt-repository ppa:deadsnakes/ppa && \
apt-get update
RUN apt-get update && apt-get install -y --no-install-recommends \
python3.6
RUN apt-get update
RUN apt-get install curl
RUN curl https://bootstrap.pypa.io/get-pip.py | python3.6
RUN python3.6 -m pip install --upgrade pip
RUN ln -sf /usr/bin/python3.6 /usr/local/bin/python3 &&\
ln -sf /usr/local/bin/pip /usr/local/bin/pip3
# Install all OS dependencies for fully functional notebook server
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
git \
curl \
freeglut3-dev \
libcupti-dev \
libcurl3-dev \
libfreetype6-dev \
libpng12-dev \
libzmq3-dev \
pkg-config \
unzip \
rsync \
software-properties-common \
inkscape \
jed \
libsm6 \
libxext-dev \
libxrender1 \
lmodern \
pandoc \
vim \
libpng-dev \
g++ \
gfortran \
libffi-dev \
libhdf5-dev \
libjpeg-dev \
liblcms2-dev \
libopenblas-dev \
liblapack-dev \
libssl-dev \
libtiff5-dev \
libwebp-dev \
nano \
libopenslide-dev \
wget \
zlib1g-dev \
qt5-default \
libvtk6-dev \
libjasper-dev \
libopenexr-dev \
libgdal-dev \
libdc1394-22-dev \
libavcodec-dev \
libavformat-dev \
libswscale-dev \
libtheora-dev \
libvorbis-dev \
libxvidcore-dev \
libx264-dev \
yasm \
libopencore-amrnb-dev \
libopencore-amrwb-dev \
libv4l-dev \
libxine2-dev \
libtbb-dev \
libeigen3-dev \
ant \
default-jdk \
doxygen \
libvips \
libvips-dev \
libvips-tools \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y --no-install-recommends \
bc \
cmake \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y \
python3-dev \
python3-tk \
python3-setuptools \
python3-numpy \
python3-scipy \
python3-nose \
python3-h5py \
python3-skimage \
python3-matplotlib \
python3-pandas \
python3-sklearn \
python3-sympy \
&& \
apt-get clean && \
apt-get autoremove && \
rm -rf /var/lib/apt/lists/*
# libav-tools for matplotlib anim
RUN apt-get update && \
apt-get install -y --no-install-recommends libav-tools && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN cd /tmp && \
wget --quiet https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh &&\
##echo "e1045ee415162f944b6aebfe560b8fee *Miniconda3-latest-Linux-x86_64.sh" | md5sum -c - && \
/bin/bash Miniconda3-latest-Linux-x86_64.sh -f -b
ENV PATH=/root/miniconda3/bin:$PATH
RUN conda install -y \
'python=3.6'
RUN conda install --yes\
Pillow \
h5py \
ipykernel \
jupyter \
matplotlib \
seaborn \
numpy \
pandas \
scipy \
bcolz \
Cython \
path.py \
six \
sphinx \
wheel \
pygments \
Flask \
scikit-image \
pandas \
tqdm \
statsmodels \
#pydicom \
#tensorboardX \
tensorflow-tensorboard \
plotly \
seaborn \
ipython
RUN conda install -y -c conda-forge \
pydicom \
tensorboardx
RUN conda install -y \
scikit-learn
RUN python3.6 -m pip install --upgrade --force-reinstall --no-cache-dir --ignore-installed \
zmq \
imgaug \
kaggle \
pretrainedmodels \
skorch
# Installing OpenSlide
RUN apt-get update && apt-get install -y openslide-tools
RUN apt-get update && apt-get install -y python3-openslide &&\
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Installing OpenCV
RUN conda install -c conda-forge opencv
ENV CUDA_HOME /usr/local/cuda-9.2
ENV LD_LIBRARY_PATH /usr/local/cuda-9.2:/usr/local/cuda-9.2/lib64:$LD_LIBRARY_PATH
ENV LD_LIBRARY_PATH /usr/local/cuda/extras/CUPTI/lib64:$LD_LIBRARY_PATH
ENV LIBRARY_PATH $LD_LIBRARY_PATH
# Install facets which does not have a pip or conda package at the moment
RUN cd /tmp && \
git clone https://github.com/PAIR-code/facets.git && \
cd facets && \
jupyter nbextension install facets-dist/ --sys-prefix && \
rm -rf facets
RUN conda install -y \
tensorboard
# Installig Tensorflow/GPU
RUN conda install -c aaronzs tensorflow
RUN conda install -c aaronzs tensorflow-gpu
# Installing Keras
RUN conda install -c anaconda keras
# Installing pytorch
RUN conda install pytorch torchvision cuda92 -c pytorch
RUN apt-get update && apt-get install libevent-dev -y
RUN python3.6 -m pip install --upgrade pip
RUN python3.6 -m pip install \
setuptools \
numpy
RUN apt-get install -y \
libmemcached-dev \
zlib1g-dev
RUN python3.6 -m pip install pylibmc
RUN apt-get update && apt-get install build-essential
RUN python3.6 -m pip install --user numpy==1.14.5 && \
cd /tmp/ &&\
git clone https://github.com/girder/large_image.git && \
cd large_image/ && \
python3.6 -m pip install -e .[openslide,memcached]
RUN python3.6 -m pip install \
scikit-build \
cmake
RUN cd /tmp/ &&\
git clone https://github.com/DigitalSlideArchive/HistomicsTK.git && \
cd HistomicsTK/ && \
python3.6 -m pip install -e .
RUN conda install --yes \
'matplotlib' \
'jupyter' \
'numpy' \
'scikit-image'
# Import matplotlib the first time to build the font cache.
ENV XDG_CACHE_HOME /home/$NB_USER/.cache/
RUN MPLBACKEND=Agg python -c "import matplotlib.pyplot"
RUN python3.6 -m pip install --upgrade --force-reinstall --no-cache-dir --ignore-installed --pre \
jupyter-tensorboard
RUN conda install -c menpo opencv3
RUN conda install -c glemaitre imbalanced-learn
RUN conda install statsmodels
RUN python3.6 -m pip install python-bioformats
RUN conda install -c soft-matter slicerator
RUN conda install -c conda-forge jpype1
RUN conda install -c conda-forge pims
###Jupyter
# Set up our notebook config.
COPY jupyter_notebook_config.py /root/.jupyter/
# Copy sample notebooks.
#COPY notebooks /notebooks
# Jupyter has issues with being run directly:
# https://github.com/ipython/ipython/issues/7062
# We just add a little wrapper script.
COPY run_jupyter.sh /
# TensorBoard
EXPOSE 6006
# IPython
EXPOSE 8888
# Openslide Server
EXPOSE 5000
WORKDIR "/notebooks"
RUN chmod +x /run_jupyter.sh
CMD ["/run_jupyter.sh", "--allow-root"]
# now clean up the unwanted source to keep image size to a minimum
RUN cd /opt && \
rm -rf /opt/opencv && \
rm -rf /opt/opencv_contrib && \
apt-get purge -y cmake && \
apt-get autoremove -y --purge