Skip to content

Instantly share code, notes, and snippets.

@ckhung
Created February 17, 2017 03:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ckhung/99d06bfed3a0b6a82c8c34105813595d to your computer and use it in GitHub Desktop.
Save ckhung/99d06bfed3a0b6a82c8c34105813595d to your computer and use it in GitHub Desktop.
a more flexible and unsafe modification of the keras docker file to allow "sudo bash", with some additional tools
# a more flexible and unsafe modification of
# https://github.com/fchollet/keras/tree/master/docker
# to allow "sudo bash", with some additional tools.
FROM nvidia/cuda:8.0-cudnn5-devel
ENV CONDA_DIR /opt/conda
ENV PATH $CONDA_DIR/bin:$PATH
RUN mkdir -p $CONDA_DIR && \
echo export PATH=$CONDA_DIR/bin:'$PATH' > /etc/profile.d/conda.sh && \
apt-get update && \
apt-get install -y wget git libhdf5-dev g++ graphviz && \
wget --quiet https://repo.continuum.io/miniconda/Miniconda3-3.9.1-Linux-x86_64.sh && \
echo "6c6b44acdd0bc4229377ee10d52c8ac6160c336d9cdd669db7371aa9344e1ac3 *Miniconda3-3.9.1-Linux-x86_64.sh" | sha256sum -c - && \
/bin/bash /Miniconda3-3.9.1-Linux-x86_64.sh -f -b -p $CONDA_DIR && \
rm Miniconda3-3.9.1-Linux-x86_64.sh
ENV NB_USER keras
ENV NB_UID 1000
RUN useradd -m -s /bin/bash -N -u $NB_UID $NB_USER && \
mkdir -p $CONDA_DIR && \
chown keras $CONDA_DIR -R && \
mkdir -p /src && \
chown keras /src
RUN apt-get install -y apt-utils sudo && \
usermod -G sudo keras && \
echo 'keras: ' | chpasswd
RUN apt-get install -y vim-tiny bash-completion lynx opencc && \
locale-gen zh_TW.UTF-8
ENV LANG zh_TW.UTF-8
ENV http_proxy http://proxy.cyut.edu.tw:3128
USER keras
# Python
ARG python_version=3.5.2
ARG tensorflow_version=0.12.0rc0-cp35-cp35m
RUN conda install -y python=${python_version}
RUN pip install jieba cython gensim jupyterthemes && \
jt -t oceans16
RUN pip install https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-${tensorflow_version}-linux_x86_64.whl && \
pip install git+git://github.com/Theano/Theano.git && \
pip install ipdb pytest pytest-cov python-coveralls coverage==3.7.1 pytest-xdist pep8 pytest-pep8 pydot_ng && \
conda install Pillow scikit-learn notebook pandas matplotlib nose pyyaml six h5py && \
pip install git+git://github.com/fchollet/keras.git && \
conda clean -yt
ADD theanorc /home/keras/.theanorc
ENV PYTHONPATH='/src/:$PYTHONPATH'
WORKDIR /src
EXPOSE 8888
CMD jupyter notebook --no-browser --ip=0.0.0.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment