-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathDockerfile.py3-cntk-gpu
59 lines (52 loc) · 1.7 KB
/
Dockerfile.py3-cntk-gpu
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
# docker-keras - Keras in Docker with Python 3 and CNTK on GPU
FROM gw000/debian-cuda:9.1_7.0
MAINTAINER gw0 [http://gw.tnode.com/] <[email protected]>
# install debian packages
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update -qq \
&& apt-get install --no-install-recommends -y \
# install essentials
build-essential \
g++ \
git \
openssh-client \
# install python 3
python3 \
python3-dev \
python3-pip \
python3-setuptools \
python3-virtualenv \
python3-wheel \
pkg-config \
# requirements for numpy
libopenblas-base \
python3-numpy \
python3-scipy \
# requirements for keras
python3-h5py \
python3-yaml \
python3-pydot \
# other repositories
ubuntu-archive-keyring \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# install from old ubuntu repositories for cntk
RUN echo 'deb http://archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse' > /etc/apt/sources.list.d/ubuntu-16.04.list
RUN apt-get update -qq \
&& apt-get install --no-install-recommends -y \
# requirements for cntk
openmpi-bin=1.10.2-8ubuntu1 \
openmpi-common=1.10.2-8ubuntu1 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
ARG CNTK_VERSION=2.4
ARG CNTK_DEVICE=GPU
RUN pip3 --no-cache-dir install https://cntk.ai/PythonWheel/${CNTK_DEVICE}/cntk-${CNTK_VERSION}-cp35-cp35m-linux_x86_64.whl
ARG KERAS_VERSION=2.1.4
ENV KERAS_BACKEND=cntk
RUN pip3 --no-cache-dir install --no-dependencies git+https://github.com/fchollet/keras.git@${KERAS_VERSION}
# quick test and dump package lists
RUN python3 -c "import cntk; print(cntk.__version__)" \
&& dpkg-query -l > /dpkg-query-l.txt \
&& pip3 freeze > /pip3-freeze.txt
WORKDIR /srv/