forked from maxpumperla/elephas
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
79ba91e
commit b0ae595
Showing
1 changed file
with
66 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,73 @@ | ||
FROM gw000/keras:2.1.3-py3-tf-gpu | ||
MAINTAINER gw0 [http://gw.tnode.com/] <[email protected]> | ||
|
||
# install py3-tf-cpu/gpu (Python 3, TensorFlow, CPU/GPU) | ||
RUN apt-get update -qq \ | ||
&& apt-get install --no-install-recommends -y \ | ||
# install python 3 | ||
python3 \ | ||
python3-dev \ | ||
python3-pip \ | ||
python3-setuptools \ | ||
python3-virtualenv \ | ||
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/* | ||
|
||
ARG TENSORFLOW_VERSION=1.10.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.1.3 | ||
ENV KERAS_BACKEND=tensorflow | ||
RUN pip3 --no-cache-dir install git+https://github.com/fchollet/keras.git@${KERAS_VERSION} | ||
|
||
# install additional debian packages | ||
RUN apt-get update -qq \ | ||
&& apt-get install --no-install-recommends -y \ | ||
# system tools | ||
less \ | ||
procps \ | ||
vim-tiny \ | ||
# build dependencies | ||
build-essential \ | ||
libffi-dev \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
ARG cuda_version=9.0 | ||
ARG cudnn_version=7 | ||
FROM nvidia/cuda:${cuda_version}-cudnn${cudnn_version}-devel | ||
|
||
# Install system packages | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
bzip2 \ | ||
g++ \ | ||
git \ | ||
graphviz \ | ||
libgl1-mesa-glx \ | ||
libhdf5-dev \ | ||
openmpi-bin \ | ||
wget && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Install conda | ||
ENV CONDA_DIR /opt/conda | ||
ENV PATH $CONDA_DIR/bin:$PATH | ||
|
||
RUN wget --quiet --no-check-certificate https://repo.continuum.io/miniconda/Miniconda3-4.2.12-Linux-x86_64.sh && \ | ||
echo "c59b3dd3cad550ac7596e0d599b91e75d88826db132e4146030ef471bb434e9a *Miniconda3-4.2.12-Linux-x86_64.sh" | sha256sum -c - && \ | ||
/bin/bash /Miniconda3-4.2.12-Linux-x86_64.sh -f -b -p $CONDA_DIR && \ | ||
rm Miniconda3-4.2.12-Linux-x86_64.sh && \ | ||
echo export PATH=$CONDA_DIR/bin:'$PATH' > /etc/profile.d/conda.sh | ||
|
||
# Install Python packages and keras | ||
ENV NB_USER keras | ||
ENV NB_UID 1000 | ||
|
||
RUN useradd -m -s /bin/bash -N -u $NB_UID $NB_USER && \ | ||
chown $NB_USER $CONDA_DIR -R && \ | ||
mkdir -p /src && \ | ||
chown $NB_USER /src | ||
|
||
USER $NB_USER | ||
|
||
ARG python_version=2.7 | ||
|
||
RUN conda install -y python=${python_version} && \ | ||
pip install --upgrade pip && \ | ||
pip install \ | ||
sklearn_pandas \ | ||
tensorflow-gpu && \ | ||
conda install \ | ||
bcolz \ | ||
h5py \ | ||
matplotlib \ | ||
mkl \ | ||
nose \ | ||
notebook \ | ||
Pillow \ | ||
pandas \ | ||
pygpu \ | ||
pyyaml \ | ||
scikit-learn \ | ||
six \ | ||
conda clean -yt | ||
|
||
ENV PYTHONPATH='/src/:$PYTHONPATH' | ||
|
||
RUN mkdir -p app | ||
WORKDIR /app | ||
COPY ./requirements.txt /app | ||
|
||
# Install requirements | ||
RUN pip3 install -r ./requirements.txt | ||
RUN pip3 install git+https://github.com/hyperopt/hyperopt.git | ||
RUN pip install -r ./requirements.txt | ||
RUN pip install git+https://github.com/hyperopt/hyperopt.git | ||
|
||
|
||
EXPOSE 8888 | ||
|
||
CMD jupyter notebook --port=8888 --ip=0.0.0.0 |