Do not pull notebook image as part of build step.
Do not assume the notebook image must be pulled from a Docker registry (it might be built locally).
This commit is contained in:
parent
31f6ebf073
commit
1d38273eef
6
Makefile
6
Makefile
@ -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
|
||||
|
55
README.md
55
README.md
@ -96,6 +96,40 @@ Configure JupyterHub and build it into a Docker image.
|
||||
make build
|
||||
```
|
||||
|
||||
## 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?
|
||||
|
Loading…
Reference in New Issue
Block a user