Skip to content

Instantly share code, notes, and snippets.

@8q
Last active May 21, 2018 08:00
Show Gist options
  • Select an option

  • Save 8q/2170181923ecaf78ada32a2efe82a0cd to your computer and use it in GitHub Desktop.

Select an option

Save 8q/2170181923ecaf78ada32a2efe82a0cd to your computer and use it in GitHub Desktop.
Dockerfile(python + jupyter+ tf + keras) from https://github.com/ufoym/deepo
# MIT License
# Copyright (c) 2017 Ming
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# ==================================================================
# module list
# ------------------------------------------------------------------
# python 3.6 (apt)
# jupyter latest (pip)
# tensorflow 1.4.0 (pip)
# keras latest (pip)
# ==================================================================
FROM nvidia/cuda:8.0-cudnn6-devel
RUN APT_INSTALL="apt-get install -y --no-install-recommends" && \
PIP_INSTALL="pip --no-cache-dir install --upgrade" && \
GIT_CLONE="git clone --depth 10" && \
rm -rf /var/lib/apt/lists/* \
/etc/apt/sources.list.d/cuda.list \
/etc/apt/sources.list.d/nvidia-ml.list && \
apt-get update && \
# ==================================================================
# tools
# ------------------------------------------------------------------
DEBIAN_FRONTEND=noninteractive $APT_INSTALL \
build-essential \
ca-certificates \
cmake \
wget \
git \
vim \
graphviz \
&& \
# ==================================================================
# python
# ------------------------------------------------------------------
DEBIAN_FRONTEND=noninteractive $APT_INSTALL \
software-properties-common \
&& \
add-apt-repository ppa:jonathonf/python-3.6 && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive $APT_INSTALL \
python3.6 \
python3.6-dev \
&& \
wget -O ~/get-pip.py \
https://bootstrap.pypa.io/get-pip.py && \
python3.6 ~/get-pip.py && \
ln -s /usr/bin/python3.6 /usr/local/bin/python3 && \
ln -s /usr/bin/python3.6 /usr/local/bin/python && \
$PIP_INSTALL \
setuptools \
&& \
$PIP_INSTALL \
numpy \
scipy \
pandas \
scikit-learn \
matplotlib \
Cython \
tqdm \
multiprocessing \
pydot-ng \
pydot3 \
&& \
# ==================================================================
# jupyter
# ------------------------------------------------------------------
$PIP_INSTALL \
jupyter \
&& \
# ==================================================================
# tensorflow
# ------------------------------------------------------------------
$PIP_INSTALL \
tensorflow-gpu==1.4.0 \
&& \
# ==================================================================
# keras
# ------------------------------------------------------------------
$PIP_INSTALL \
h5py \
keras \
&& \
# ==================================================================
# config & cleanup
# ------------------------------------------------------------------
ldconfig && \
apt-get clean && \
apt-get autoremove && \
rm -rf /var/lib/apt/lists/* /tmp/* ~/*
EXPOSE 8888 6006
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment