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.
This commit is contained in:
Min RK
2016-04-18 14:38:39 +02:00
parent f3bbca80ea
commit 9cdda101c7
4 changed files with 20 additions and 11 deletions

View File

@@ -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 # Build your own derivative images starting with
# #
# FROM jupyter/jupyterhub:latest # 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 FROM debian:jessie
MAINTAINER Jupyter Project <jupyter@googlegroups.com> MAINTAINER Jupyter Project <jupyter@googlegroups.com>
# install nodejs, utf8 locale # install nodejs, utf8 locale
@@ -32,21 +36,14 @@ ENV PATH=/opt/conda/bin:$PATH
# install js dependencies # install js dependencies
RUN npm install -g configurable-http-proxy && rm -rf ~/.npm RUN npm install -g configurable-http-proxy && rm -rf ~/.npm
WORKDIR /srv/
ADD . /srv/jupyterhub ADD . /srv/jupyterhub
WORKDIR /srv/jupyterhub/ WORKDIR /srv/jupyterhub/
RUN python setup.py js && pip install . && \ RUN python setup.py js && pip install . && \
rm -rf node_modules ~/.cache ~/.npm 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 EXPOSE 8000
LABEL org.jupyter.service="jupyterhub" LABEL org.jupyter.service="jupyterhub"
ONBUILD ADD jupyterhub_config.py /srv/jupyterhub/jupyterhub_config.py CMD ["jupyterhub"]
CMD ["jupyterhub", "-f", "/srv/jupyterhub/jupyterhub_config.py"]

11
Dockerfile.onbuild Normal file
View File

@@ -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"]

View File

@@ -9,3 +9,4 @@ dependencies:
test: test:
override: override:
- docker build -t jupyter/jupyterhub . - docker build -t jupyter/jupyterhub .
- docker build -t jupyter/jupyterhub-onbuild -f Dockerfile.onbuild .

View File

@@ -1,4 +1,4 @@
FROM jupyter/jupyterhub FROM jupyter/jupyterhub-onbuild
MAINTAINER Jupyter Project <jupyter@googlegroups.com> MAINTAINER Jupyter Project <jupyter@googlegroups.com>