forked from alexisylchan/introdl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.cpu
113 lines (99 loc) · 2.8 KB
/
Dockerfile.cpu
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
FROM ubuntu:14.04
ARG TENSORFLOW_VERSION=0.10.0
ARG TENSORFLOW_ARCH=cpu
# Install some dependencies
RUN apt-get update && apt-get install -y \
bc \
build-essential \
cmake \
curl \
g++ \
gfortran \
git \
libffi-dev \
libfreetype6-dev \
libhdf5-dev \
libjpeg-dev \
liblcms2-dev \
libopenblas-dev \
liblapack-dev \
libopenjpeg2 \
libpng12-dev \
libssl-dev \
libtiff5-dev \
libwebp-dev \
libzmq3-dev \
nano \
pkg-config \
python-dev \
software-properties-common \
unzip \
vim \
wget \
zlib1g-dev \
&& \
apt-get clean && \
apt-get autoremove && \
rm -rf /var/lib/apt/lists/* && \
# Link BLAS library to use OpenBLAS using the alternatives mechanism (https://www.scipy.org/scipylib/building/linux.html#debian-ubuntu)
update-alternatives --set libblas.so.3 /usr/lib/openblas-base/libblas.so.3
# Install pip
RUN curl -O https://bootstrap.pypa.io/get-pip.py && \
python get-pip.py && \
rm get-pip.py
# Add SNI support to Python
RUN pip --no-cache-dir install \
pyopenssl \
ndg-httpsclient \
pyasn1
# Install useful Python packages using apt-get to avoid version incompatibilities with Tensorflow binary
# especially numpy, scipy, skimage and sklearn (see https://github.com/tensorflow/tensorflow/issues/2034)
RUN apt-get update && apt-get install -y \
python-pip \
python-setuptools \
&& \
apt-get clean && \
apt-get autoremove && \
rm -rf /var/lib/apt/lists/*
# Install other useful Python packages using pip
RUN pip --no-cache-dir install --upgrade ipython && \
pip --no-cache-dir install \
Cython \
numpy \
scipy \
nose \
h5py \
scikit-image \
matplotlib \
pandas \
scikit-learn \
sympy \
ipykernel \
jupyter \
path.py \
Pillow \
plotly \
pygments \
seaborn \
six \
sphinx \
wheel \
zmq \
&& \
python -m ipykernel.kernelspec
# Install TensorFlow
RUN pip --no-cache-dir install \
https://storage.googleapis.com/tensorflow/linux/${TENSORFLOW_ARCH}/tensorflow-${TENSORFLOW_VERSION}-cp27-none-linux_x86_64.whl
# Install Keras
ARG KERAS_VERSION=1.1.0
ENV KERAS_BACKEND=tensorflow
RUN pip --no-cache-dir install git+git://github.com/fchollet/keras.git@${KERAS_VERSION}
# Set up notebook config
COPY jupyter_notebook_config.py /root/.jupyter/
# Uncomment the following two lines if you're using windows
# COPY run_jupyter.sh /root/
# COPY demo/ /root/demo/
# Expose Ports for TensorBoard (6006), Ipython (8888)
EXPOSE 6006 8888
WORKDIR "/root"
CMD ["/bin/bash"]