├── init.sh └── Dockerfile /init.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | trap 'pkill -f jupyter-notebook; sleep 3; exit 0' EXIT 3 | 4 | if [ "${PASSWORD-undef}" = "undef" ]; then 5 | export PASSWORD='passw0rd' 6 | fi 7 | 8 | if ! grep -qE '^c.NotebookApp.password =' $HOME/.jupyter/jupyter_notebook_config.py; then 9 | HASH=$(python -c "from IPython.lib import passwd; print(passwd('${PASSWORD}'))") 10 | echo "c.NotebookApp.password = u'${HASH}'" >>$HOME/.jupyter/jupyter_notebook_config.py 11 | fi 12 | unset PASSWORD 13 | unset HASH 14 | 15 | mkdir -p $HOME/notebook 16 | cd $HOME/notebook 17 | ipython -c '%matplotlib' # build font cache for matplotlib 18 | jupyter notebook 19 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM centos:7 2 | MAINTAINER Etsuji Nakai 3 | RUN yum -y update 4 | RUN yum -y groupinstall "Development Tools" 5 | RUN yum -y install epel-release && \ 6 | yum -y install python-devel python-pip lapack-devel freetype-devel \ 7 | libpng-devel libjpeg-turbo-devel ImageMagick 8 | RUN pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.10.0-cp27-none-linux_x86_64.whl 9 | RUN pip install pandas scipy jupyter && \ 10 | pip install scikit-learn matplotlib Pillow && \ 11 | pip install google-api-python-client 12 | RUN cd /etc/yum.repos.d && \ 13 | curl -LO http://www.graphviz.org/graphviz-rhel.repo && \ 14 | cd /tmp && \ 15 | curl -LO http://www.graphviz.org/pub/graphviz/stable/redhat/el7Server/x86_64/os/gts-0.7.6-21.20111025.el7.x86_64.rpm && \ 16 | yum -y install graphviz graphviz-gd gts-0.7.6-21.20111025.el7.x86_64.rpm 17 | 18 | RUN jupyter notebook --generate-config && \ 19 | ipython profile create 20 | RUN echo "c.NotebookApp.ip = '*'" >>/root/.jupyter/jupyter_notebook_config.py && \ 21 | echo "c.NotebookApp.open_browser = False" >>/root/.jupyter/jupyter_notebook_config.py && \ 22 | echo "c.InteractiveShellApp.matplotlib = 'inline'" >>/root/.ipython/profile_default/ipython_config.py 23 | #RUN echo "c.Application.log_level = 'DEBUG'" >>/root/.jupyter/jupyter_notebook_config.py 24 | 25 | ADD init.sh /usr/local/bin/init.sh 26 | RUN chmod u+x /usr/local/bin/init.sh 27 | EXPOSE 8888 28 | CMD ["/usr/local/bin/init.sh"] 29 | --------------------------------------------------------------------------------