Merge pull request #13 from jtyberg/make_build

Do not pull notebook image as part of build step.
This commit is contained in:
Min RK 2016-05-13 10:28:42 +02:00
commit 12520da5bd
2 changed files with 41 additions and 26 deletions

View File

@ -31,10 +31,12 @@ check-files: secrets/jupyterhub.crt secrets/jupyterhub.key userlist
pull:
docker pull $(DOCKER_NOTEBOOK_IMAGE)
build: check-files pull network volumes
notebook_image: pull
build: check-files network volumes
docker-compose build
up:
docker-compose up -d
.PHONY: network volumes check-files build up
.PHONY: network volumes check-files pull notebook_image build up

View File

@ -96,7 +96,41 @@ Configure JupyterHub and build it into a Docker image.
make build
```
## Run JupyterHub
## Prepare the Jupyter Notebook Image
You can configure JupyterHub to spawn Notebook servers from any Docker image, as
long as the image's `ENTRYPOINT` and/or `CMD` starts a single-user instance of
Jupyter Notebook server that is compatible with JupyterHub.
To specify which Notebook image to spawn for users, you set the value of the
`DOCKER_NOTEBOOK_IMAGE` environment variable to the desired container image.
You can set this variable in the `.env` file, or alternatively, you can
override the value in this file by setting `DOCKER_NOTEBOOK_IMAGE` in the
environment where you launch JupyterHub.
Whether you build a custom Notebook image or pull an image from a public or
private Docker registry, the image must reside on the host.
If the Notebook image does not exist on host, Docker will attempt to pull the
image the first time a user attempts to start his or her server. In such cases,
JupyterHub may timeout if the image being pulled is large, so it is better to
pull the image to the host before running JupyterHub.
This deployment defaults to the
[jupyter/scipy-notebook](https://hub.docker.com/r/jupyter/scipy-notebook/)
Notebook image, which is built from the `scipy-notebook`
[Docker stacks](https://github.com/jupyter/docker-stacks). (Note that the Docker
stacks `*-notebook` images tagged `2d878db5cbff` include the
`start-singleuser.sh` script required to start a single-user instance of the
Notebook server that is compatible with JupyterHub).
You can pull the image using the following command:
```
make notebook_image
```
## Run JupyterHub
Run the JupyterHub container on the host.
@ -143,27 +177,6 @@ Create a Docker volume to persist JupyterHub data. This volume will reside on
docker volume create --name jupyterhub-data
```
### Pull the Jupyter Notebook Image
Pull the Jupyter Notebook Docker image that you would like JupyterHub to spawn for each user.
Note: Even though Docker will pull the image to the host the first time a user container is spawned, JupyterHub may timeout if the image is large, so it's better to do it beforehand.
This deployment uses the [jupyter/scipy-notebook](https://hub.docker.com/r/jupyter/scipy-notebook/) Docker image, which is built from the `scipy-notebook` [Docker stacks](https://github.com/jupyter/docker-stacks).
Note that the Docker stacks `*-notebook` images tagged `2d878db5cbff` include the `start-singleuser.sh` script required to start a single-user instance of the Notebook server that is compatible with JupyterHub.
```
make pull
```
Note: If you choose to use a container image other than
``jupyter/scipy-notebook``, you must change the `DOCKER_NOTEBOOK_IMAGE` value
of the `.env` file to the desired container image. Alternatively, you can
override the value by setting the `DOCKER_NOTEBOOK_IMAGE` variable to a
different Notebook image in the environment where you launch JupyterHub.
## FAQ
### How can I view the logs for JupyterHub or users' Notebook servers?