From 70f63744f2f56ce7cb459733360e8d9d54447c8e Mon Sep 17 00:00:00 2001 From: Kyle Kelley Date: Fri, 12 Sep 2014 16:46:41 +0000 Subject: [PATCH 01/16] Dockerfile to track the latest master --- Dockerfile | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..65fc98e54 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,28 @@ +FROM ipython/scipystack + +MAINTAINER IPython Project + +ADD . /srv/ipython/ +WORKDIR /srv/ipython/ + +RUN pip2 install -e .[all] +RUN pip3 install -e .[all] + +#RUN ipython2 kernelspec install-self +#RUN ipython3 kernelspec install-self + +EXPOSE 8888 + +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 + +RUN useradd -m -s /bin/bash jupyter + +USER jupyter +ENV HOME /home/jupyter +ENV SHELL /bin/bash +ENV USER jupyter + +WORKDIR /home/jupyter/ + +CMD ["/usr/local/bin/notebook.sh"] From 73f75ab4fb1081a6d28af1937bdf68d39c0588d1 Mon Sep 17 00:00:00 2001 From: Kyle Kelley Date: Fri, 12 Sep 2014 17:37:41 +0000 Subject: [PATCH 02/16] install direct dependencies, kernels --- Dockerfile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 65fc98e54..9eb45f5a9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,11 +5,11 @@ MAINTAINER IPython Project ADD . /srv/ipython/ WORKDIR /srv/ipython/ -RUN pip2 install -e .[all] -RUN pip3 install -e .[all] +RUN pip2 install fabric +RUN pip3 install jsonschema jsonpointer fabric -#RUN ipython2 kernelspec install-self -#RUN ipython3 kernelspec install-self +RUN pip2 install . +RUN pip3 install . EXPOSE 8888 @@ -25,4 +25,7 @@ ENV USER jupyter WORKDIR /home/jupyter/ +RUN ipython2 kernelspec install-self +RUN ipython3 kernelspec install-self + CMD ["/usr/local/bin/notebook.sh"] From 3231bfe2f674047c4184f47980ccced6ff08b75c Mon Sep 17 00:00:00 2001 From: Kyle Kelley Date: Fri, 12 Sep 2014 17:38:36 +0000 Subject: [PATCH 03/16] Instructions inside the Dockerfile --- Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Dockerfile b/Dockerfile index 9eb45f5a9..32745bcd5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,7 @@ +# Designed to be run as +# +# docker run -it -p 9999:8888 ipython/latest + FROM ipython/scipystack MAINTAINER IPython Project From b4e8ee3101d4335c848672b549965979caf3a143 Mon Sep 17 00:00:00 2001 From: Kyle Kelley Date: Sat, 13 Sep 2014 17:33:24 +0000 Subject: [PATCH 04/16] Submodule updating, comments --- Dockerfile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Dockerfile b/Dockerfile index 32745bcd5..93a757e9b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,17 +9,24 @@ MAINTAINER IPython Project ADD . /srv/ipython/ WORKDIR /srv/ipython/ +# Installing certain dependencies directly RUN pip2 install fabric RUN pip3 install jsonschema jsonpointer fabric +RUN git submodule update --init + +# .[all] only works with -e +# Can't use -e because ipython2 and ipython3 will clobber each other RUN pip2 install . RUN pip3 install . EXPOSE 8888 +# Generate a wrapper script 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 +# jupyter is our user RUN useradd -m -s /bin/bash jupyter USER jupyter @@ -29,6 +36,7 @@ ENV USER jupyter WORKDIR /home/jupyter/ +# Register each kernel (Python 2.7.x, Python 3.4.x) RUN ipython2 kernelspec install-self RUN ipython3 kernelspec install-self From 3db038faed390cccc68f4ad28c442293575005ed Mon Sep 17 00:00:00 2001 From: Kyle Kelley Date: Sat, 13 Sep 2014 18:31:48 +0000 Subject: [PATCH 05/16] Try out setup.py submodule --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 93a757e9b..9c34be4cd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ WORKDIR /srv/ipython/ RUN pip2 install fabric RUN pip3 install jsonschema jsonpointer fabric -RUN git submodule update --init +RUN python setup.py submodule # .[all] only works with -e # Can't use -e because ipython2 and ipython3 will clobber each other From 88657b8d3b0926d2f5eba1952816789bdc776aad Mon Sep 17 00:00:00 2001 From: Kyle Kelley Date: Sat, 13 Sep 2014 19:30:22 +0000 Subject: [PATCH 06/16] Clone ipython/ipython directly --- Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 9c34be4cd..7abe6aea2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,10 @@ FROM ipython/scipystack MAINTAINER IPython Project -ADD . /srv/ipython/ +# 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 WORKDIR /srv/ipython/ # Installing certain dependencies directly From b0159a3bdb5fd4931cfd90a5555eccbac206cad7 Mon Sep 17 00:00:00 2001 From: Kyle Kelley Date: Sat, 13 Sep 2014 20:48:23 +0000 Subject: [PATCH 07/16] /srv/ was already created, just ensure its there --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 7abe6aea2..3e239b1b7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ FROM ipython/scipystack MAINTAINER IPython Project # Can't directly add the source as it won't have the submodules -RUN mkdir /srv/ +RUN mkdir -p /srv/ WORKDIR /srv/ RUN git clone --recursive https://github.com/ipython/ipython.git WORKDIR /srv/ipython/ From 89b4ef2660baa2351d2ccaa33ff5541a2107bafa Mon Sep 17 00:00:00 2001 From: Kyle Kelley Date: Sat, 13 Sep 2014 23:54:30 +0000 Subject: [PATCH 08/16] Create IPython profile with jupyter permissions --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3e239b1b7..b804715f0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -40,7 +40,7 @@ ENV USER jupyter WORKDIR /home/jupyter/ # Register each kernel (Python 2.7.x, Python 3.4.x) -RUN ipython2 kernelspec install-self -RUN ipython3 kernelspec install-self +RUN su - jupyter -c "ipython2 kernelspec install-self" +RUN su - jupyter -c "ipython3 kernelspec install-self" CMD ["/usr/local/bin/notebook.sh"] From 8b61460bede5ffbdb2837fa5876d35ba0c43a5f8 Mon Sep 17 00:00:00 2001 From: Kyle Kelley Date: Sun, 14 Sep 2014 00:55:30 +0000 Subject: [PATCH 09/16] Workaround limitations in Docker Hub --- Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index b804715f0..cc026d711 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,6 +32,10 @@ RUN chmod a+x /usr/local/bin/notebook.sh # jupyter is our user RUN useradd -m -s /bin/bash jupyter +# Register each kernel (Python 2.7.x, Python 3.4.x) +RUN sudo -E -H -u jupyter ipython2 kernelspec install-self +RUN sudo -E -H -u jupyter ipython3 kernelspec install-self + USER jupyter ENV HOME /home/jupyter ENV SHELL /bin/bash @@ -39,8 +43,4 @@ ENV USER jupyter WORKDIR /home/jupyter/ -# Register each kernel (Python 2.7.x, Python 3.4.x) -RUN su - jupyter -c "ipython2 kernelspec install-self" -RUN su - jupyter -c "ipython3 kernelspec install-self" - CMD ["/usr/local/bin/notebook.sh"] From f79edfc29014caa6c63d74d87f07e77c11c11a06 Mon Sep 17 00:00:00 2001 From: Kyle Kelley Date: Sun, 14 Sep 2014 01:23:25 +0000 Subject: [PATCH 10/16] Permissions everywhere --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index cc026d711..4dafb3756 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,6 +36,8 @@ RUN useradd -m -s /bin/bash jupyter RUN sudo -E -H -u jupyter ipython2 kernelspec install-self RUN sudo -E -H -u jupyter ipython3 kernelspec install-self +RUN sudo chown jupyter:jupyter /home/jupyter -R + USER jupyter ENV HOME /home/jupyter ENV SHELL /bin/bash From 66bdfded98be8a291d94c1f2c5bf35248ce2d39b Mon Sep 17 00:00:00 2001 From: Kyle Kelley Date: Sun, 14 Sep 2014 02:54:07 +0000 Subject: [PATCH 11/16] More workarounds --- Dockerfile | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4dafb3756..1b5864ba0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,18 +26,12 @@ RUN pip3 install . EXPOSE 8888 # Generate a wrapper script -RUN echo "#!/bin/bash\nipython3 notebook --no-browser --port 8888 --ip=0.0.0.0" > /usr/local/bin/notebook.sh +RUN echo "#!/bin/bash\nipython2 kernelspec install-self\nipython3 kernelspec install-self\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 # jupyter is our user RUN useradd -m -s /bin/bash jupyter -# Register each kernel (Python 2.7.x, Python 3.4.x) -RUN sudo -E -H -u jupyter ipython2 kernelspec install-self -RUN sudo -E -H -u jupyter ipython3 kernelspec install-self - -RUN sudo chown jupyter:jupyter /home/jupyter -R - USER jupyter ENV HOME /home/jupyter ENV SHELL /bin/bash From 78b7d5f800cdb093e570cfabf285a2d15036f93b Mon Sep 17 00:00:00 2001 From: Kyle Kelley Date: Thu, 18 Sep 2014 14:34:32 -0500 Subject: [PATCH 12/16] Switch back to ADD --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 1b5864ba0..911ed11d2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,7 @@ MAINTAINER IPython Project # Can't directly add the source as it won't have the submodules RUN mkdir -p /srv/ WORKDIR /srv/ -RUN git clone --recursive https://github.com/ipython/ipython.git +ADD . /srv/ipython WORKDIR /srv/ipython/ # Installing certain dependencies directly From e0b822b264129b86bc47330e121d0813619dff14 Mon Sep 17 00:00:00 2001 From: Kyle Kelley Date: Thu, 18 Sep 2014 14:35:49 -0500 Subject: [PATCH 13/16] Toss opinionated user creation out --- Dockerfile | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/Dockerfile b/Dockerfile index 911ed11d2..15b96c6f1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,21 +22,3 @@ RUN python setup.py submodule # Can't use -e because ipython2 and ipython3 will clobber each other RUN pip2 install . RUN pip3 install . - -EXPOSE 8888 - -# Generate a wrapper script -RUN echo "#!/bin/bash\nipython2 kernelspec install-self\nipython3 kernelspec install-self\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 - -# jupyter is our user -RUN useradd -m -s /bin/bash jupyter - -USER jupyter -ENV HOME /home/jupyter -ENV SHELL /bin/bash -ENV USER jupyter - -WORKDIR /home/jupyter/ - -CMD ["/usr/local/bin/notebook.sh"] From c36b861209a2518dd6e210e046ced1bad2a1d577 Mon Sep 17 00:00:00 2001 From: Kyle Kelley Date: Thu, 18 Sep 2014 15:19:54 -0500 Subject: [PATCH 14/16] Definitely don't want the direct submodule stuff --- Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 15b96c6f1..6ab8eeb63 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,8 +16,6 @@ WORKDIR /srv/ipython/ RUN pip2 install fabric RUN pip3 install jsonschema jsonpointer fabric -RUN python setup.py submodule - # .[all] only works with -e # Can't use -e because ipython2 and ipython3 will clobber each other RUN pip2 install . From 9611044373b8fcace1a36a914301a4f4ccabeacc Mon Sep 17 00:00:00 2001 From: Kyle Kelley Date: Sat, 20 Sep 2014 12:48:20 -0500 Subject: [PATCH 15/16] Update Dockerfile --- Dockerfile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6ab8eeb63..c1cd65160 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,10 @@ -# Designed to be run as -# -# docker run -it -p 9999:8888 ipython/latest +# Just installs IPython from master +# Another Docker container should build from this one to see the Notebook itself FROM ipython/scipystack MAINTAINER IPython Project -# Can't directly add the source as it won't have the submodules RUN mkdir -p /srv/ WORKDIR /srv/ ADD . /srv/ipython From 52434ef364c7d61beecac661c431346b4af34fc8 Mon Sep 17 00:00:00 2001 From: MinRK Date: Wed, 24 Sep 2014 15:32:15 -0700 Subject: [PATCH 16/16] use file://$PWD#egg=ipython[all] in Dockerfile so we can install ipython[all] with pip. Because .[all] doesn't work for whatever reason. Removes need to install other dependencies with pip beforehand. --- Dockerfile | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index c1cd65160..030981a4f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,16 +5,20 @@ FROM ipython/scipystack MAINTAINER IPython Project +RUN apt-get -y install fabric + RUN mkdir -p /srv/ WORKDIR /srv/ ADD . /srv/ipython WORKDIR /srv/ipython/ +RUN chmod -R +rX /srv/ipython -# Installing certain dependencies directly -RUN pip2 install fabric -RUN pip3 install jsonschema jsonpointer fabric - -# .[all] only works with -e +# .[all] only works with -e, so use file://path#egg # Can't use -e because ipython2 and ipython3 will clobber each other -RUN pip2 install . -RUN pip3 install . +RUN pip2 install --upgrade file:///srv/ipython#egg=ipython[all] +RUN pip3 install --upgrade file:///srv/ipython#egg=ipython[all] + +# install kernels +RUN python2 -m IPython kernelspec install-self --system +RUN python3 -m IPython kernelspec install-self --system +