# docker-keras - Keras in Docker with Python 3 and TensorFlow on GPU FROM gw000/debian-cuda:9.1_7.0 MAINTAINER gw0 [http://gw.tnode.com/] # 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 \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* # manually update numpy RUN pip3 --no-cache-dir install -U numpy==1.13.3 ARG TENSORFLOW_VERSION=1.5.0 ARG TENSORFLOW_DEVICE=gpu ARG TENSORFLOW_APPEND=_gpu RUN pip3 --no-cache-dir install https://storage.googleapis.com/tensorflow/linux/${TENSORFLOW_DEVICE}/tensorflow${TENSORFLOW_APPEND}-${TENSORFLOW_VERSION}-cp35-cp35m-linux_x86_64.whl ARG KERAS_VERSION=2.0.6 ENV KERAS_BACKEND=tensorflow RUN pip3 --no-cache-dir install --no-dependencies git+https://github.com/fchollet/keras.git@${KERAS_VERSION} && pip3 install pandas Pillow # quick test and dump package lists RUN python3 -c "import tensorflow; print(tensorflow.__version__)" \ && dpkg-query -l > /dpkg-query-l.txt \ && pip3 freeze > /pip3-freeze.txt ENV PYTHONUNBUFFERED=TRUE ENV PYTHONDONTWRITEBYTECODE=TRUE ENV PATH="/opt/program:${PATH}" COPY customkeras /opt/program WORKDIR /opt/program