-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathDockerfile.py2-th-cpu
47 lines (41 loc) · 1.23 KB
/
Dockerfile.py2-th-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
# docker-keras - Keras in Docker with Python 2 and Theano on CPU
FROM debian:stretch
MAINTAINER gw0 [http://gw.tnode.com/] <gw.2018@ena.one>
# 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 2
python \
python-dev \
python-pip \
python-setuptools \
python-virtualenv \
python-wheel \
pkg-config \
# requirements for numpy
libopenblas-base \
python-numpy \
python-scipy \
# requirements for keras
python-h5py \
python-yaml \
python-pydot \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
ARG THEANO_VERSION=1.0.1
ENV THEANO_FLAGS='device=cpu,floatX=float32'
RUN pip --no-cache-dir install git+https://github.com/Theano/Theano.git@rel-${THEANO_VERSION}
ARG KERAS_VERSION=2.1.4
ENV KERAS_BACKEND=theano
RUN pip --no-cache-dir install --no-dependencies git+https://github.com/fchollet/keras.git@${KERAS_VERSION}
# quick test and dump package lists
RUN python -c "import theano; print(theano.__version__)" \
&& dpkg-query -l > /dpkg-query-l.txt \
&& pip2 freeze > /pip2-freeze.txt
WORKDIR /srv/