From 9cdda101c722a81c995f33cab98ad3edd6daeda7 Mon Sep 17 00:00:00 2001 From: Min RK Date: Mon, 18 Apr 2016 14:38:39 +0200 Subject: [PATCH] Move onbuild step to jupyterhub-onbuild Removes onbuild from from jupyter/jupyterhub image, though it remains incomplete and will not run without a config file. --- Dockerfile | 17 +++++++---------- Dockerfile.onbuild | 11 +++++++++++ circle.yml | 1 + examples/postgres/hub/Dockerfile | 2 +- 4 files changed, 20 insertions(+), 11 deletions(-) create mode 100644 Dockerfile.onbuild diff --git a/Dockerfile b/Dockerfile index 80f29079..8d69eeb8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,16 @@ -# A base docker image that includes juptyerhub and IPython master +# An incomplete base docker image for running JupyterHub # # Build your own derivative images starting with # # FROM jupyter/jupyterhub:latest # +# And put your jupyterhub_config.py in /srv/jupyterhub/jupyterhub_config.py. +# +# If you base on jupyter/jupyterhub-onbuild +# your jupyterhub_config.py will be added automatically +# from your docker directory. FROM debian:jessie - MAINTAINER Jupyter Project # install nodejs, utf8 locale @@ -32,21 +36,14 @@ ENV PATH=/opt/conda/bin:$PATH # install js dependencies RUN npm install -g configurable-http-proxy && rm -rf ~/.npm -WORKDIR /srv/ ADD . /srv/jupyterhub WORKDIR /srv/jupyterhub/ RUN python setup.py js && pip install . && \ rm -rf node_modules ~/.cache ~/.npm -WORKDIR /srv/jupyterhub/ - -# Derivative containers should add jupyterhub config, -# which will be used when starting the application. - EXPOSE 8000 LABEL org.jupyter.service="jupyterhub" -ONBUILD ADD jupyterhub_config.py /srv/jupyterhub/jupyterhub_config.py -CMD ["jupyterhub", "-f", "/srv/jupyterhub/jupyterhub_config.py"] +CMD ["jupyterhub"] diff --git a/Dockerfile.onbuild b/Dockerfile.onbuild new file mode 100644 index 00000000..c9e75e66 --- /dev/null +++ b/Dockerfile.onbuild @@ -0,0 +1,11 @@ +# JupyterHub Dockerfile that loads your jupyterhub_config.py +# +# Adds ONBUILD step to jupyter/jupyterhub to load your juptyerhub_config.py into the image +# +# Derivative images must have jupyterhub_config.py next to the Dockerfile. + +FROM jupyter/jupyterhub + +ONBUILD ADD jupyterhub_config.py /srv/jupyterhub/jupyterhub_config.py + +CMD ["jupyterhub", "-f", "/srv/jupyterhub/jupyterhub_config.py"] diff --git a/circle.yml b/circle.yml index 0a3a1227..55ea2b3a 100644 --- a/circle.yml +++ b/circle.yml @@ -9,3 +9,4 @@ dependencies: test: override: - docker build -t jupyter/jupyterhub . + - docker build -t jupyter/jupyterhub-onbuild -f Dockerfile.onbuild . diff --git a/examples/postgres/hub/Dockerfile b/examples/postgres/hub/Dockerfile index 1e6602fa..a1665a43 100644 --- a/examples/postgres/hub/Dockerfile +++ b/examples/postgres/hub/Dockerfile @@ -1,4 +1,4 @@ -FROM jupyter/jupyterhub +FROM jupyter/jupyterhub-onbuild MAINTAINER Jupyter Project