notebook/Dockerfile

44 lines
989 B
Docker
Raw Normal View History

2014-09-13 01:38:36 +08:00
# Designed to be run as
#
# docker run -it -p 9999:8888 ipython/latest
2014-09-13 00:46:41 +08:00
FROM ipython/scipystack
MAINTAINER IPython Project <ipython-dev@scipy.org>
ADD . /srv/ipython/
WORKDIR /srv/ipython/
2014-09-14 01:33:24 +08:00
# Installing certain dependencies directly
2014-09-13 01:37:41 +08:00
RUN pip2 install fabric
RUN pip3 install jsonschema jsonpointer fabric
2014-09-13 00:46:41 +08:00
2014-09-14 01:33:24 +08:00
RUN git submodule update --init
# .[all] only works with -e
# Can't use -e because ipython2 and ipython3 will clobber each other
2014-09-13 01:37:41 +08:00
RUN pip2 install .
RUN pip3 install .
2014-09-13 00:46:41 +08:00
EXPOSE 8888
2014-09-14 01:33:24 +08:00
# Generate a wrapper script
2014-09-13 00:46:41 +08:00
RUN echo "#!/bin/bash\nipython3 notebook --no-browser --port 8888 --ip=0.0.0.0" > /usr/local/bin/notebook.sh
RUN chmod a+x /usr/local/bin/notebook.sh
2014-09-14 01:33:24 +08:00
# jupyter is our user
2014-09-13 00:46:41 +08:00
RUN useradd -m -s /bin/bash jupyter
USER jupyter
ENV HOME /home/jupyter
ENV SHELL /bin/bash
ENV USER jupyter
WORKDIR /home/jupyter/
2014-09-14 01:33:24 +08:00
# Register each kernel (Python 2.7.x, Python 3.4.x)
2014-09-13 01:37:41 +08:00
RUN ipython2 kernelspec install-self
RUN ipython3 kernelspec install-self
2014-09-13 00:46:41 +08:00
CMD ["/usr/local/bin/notebook.sh"]