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>
|
|
|
|
|
2014-09-14 03:30:22 +08:00
|
|
|
# Can't directly add the source as it won't have the submodules
|
|
|
|
RUN mkdir /srv/
|
|
|
|
WORKDIR /srv/
|
|
|
|
RUN git clone --recursive https://github.com/ipython/ipython.git
|
2014-09-13 00:46:41 +08:00
|
|
|
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 02:31:48 +08:00
|
|
|
RUN python setup.py submodule
|
2014-09-14 01:33:24 +08:00
|
|
|
|
|
|
|
# .[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"]
|