Last active
August 29, 2015 14:23
-
-
Save ixixi/e995f8b3a8709c528b4f to your computer and use it in GitHub Desktop.
Jupyter_Chainer Dockerfile
This file contains hidden or 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
FROM jupyter/minimal | |
# referenced : https://github.com/jupyter/docker-demo-images | |
USER jovyan | |
ENV HOME /home/jovyan | |
ENV SHELL /bin/bash | |
ENV USER jovyan | |
ENV PATH $CONDA_DIR/bin:$CONDA_DIR/envs/python2/bin:$PATH | |
WORKDIR $HOME | |
USER jovyan | |
RUN conda install --yes numpy pandas scikit-learn scikit-image matplotlib scipy seaborn sympy cython patsy statsmodels cloudpickle dill numba bokeh && conda clean -yt | |
RUN conda create -p $CONDA_DIR/envs/python2 python=2.7 ipython numpy pandas scikit-learn scikit-image matplotlib scipy seaborn sympy cython patsy statsmodels cloudpickle dill numba bokeh && conda clean -yt | |
RUN $CONDA_DIR/envs/python2/bin/python $CONDA_DIR/envs/python2/bin/ipython kernelspec install-self --user | |
# Install CUDA | |
USER root | |
RUN apt-get purge nvidia* | |
ENV CUDA_RUN http://developer.download.nvidia.com/compute/cuda/7_0/Prod/local_installers/cuda_7.0.28_linux.run | |
RUN apt-get update && apt-get install -q -y \ | |
wget \ | |
build-essential | |
RUN cd /opt && \ | |
wget $CUDA_RUN && \ | |
chmod +x *.run | |
RUN cd /opt && mkdir nvidia_installers && \ | |
./cuda_7.0.*.run -extract=`pwd`/nvidia_installers | |
RUN apt-get install -y module-init-tools | |
RUN cd /opt/nvidia_installers && \ | |
./NVIDIA-Linux-x86_64-*.run -s -N --no-kernel-module | |
RUN cd /opt/nvidia_installers && \ | |
./cuda-linux64-rel-7.0*.run -noprompt | |
ENV CUDA_HOME=/usr/local/cuda-7.0 | |
ENV LD_LIBRARY_PATH=${CUDA_HOME}/lib64 | |
ENV PATH=${CUDA_HOME}/bin:${PATH} | |
# Install Chainer | |
USER jovyan | |
RUN /opt/conda/envs/python2/bin/pip install chainer chainer-cuda-deps | |
RUN git clone https://github.com/pfnet/chainer.git | |
CMD ipython notebook |
This file contains hidden or 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
$ docker build -t jupyter_chainer . | |
$ docker run -d -it \ | |
--device /dev/nvidia0:/dev/nvidia0 \ | |
--device /dev/nvidia1:/dev/nvidia1 \ | |
--device /dev/nvidia2:/dev/nvidia2 \ | |
--device /dev/nvidiactl:/dev/nvidiactl \ | |
--device /dev/nvidia-uvm:/dev/nvidia-uvm \ | |
-p 8888:8888 \ | |
-v /path/to/notbookedata/:/home/jovyan/notebookdata \ | |
jupyter_chainer |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment