This image is made for building customized jupyterhub profile/server option images. It was originally based on datajoint/djlab all the way up to datajoint/djbase. To reduce the maintenance effort, we decided to use quay.io/jupyter/minimal-notebook as the base image. We also kept the previous implementation under legacy directory, just in case there are unforeseen issues with the new implementation.
Note:
datajoint/djlabis deprecated since thesingleuserpart of this image overlaps with thedjlabimage, it'll run jupyter lab server by default.
Directory explain:
~/legacycontains the old implementation of the image~/singleuseris used to build the jupyterhub profile images~/hubis a Docker based jupyterhub host server using DockerSpawner and Docker-in-Docker to launch jupyterhub singleuser server as a Docker container, in order to locally validate the singleuser images for development purpose.(Don't recommend to use this in production, due to the security concern of Docker-in-Docker)
We put all the dependencies in the ~/singleuser/config directory including:
apt_install.shfor system level dependenciespip_requirements.txtfor python packagesbefore_start_hook.shto run before the jupyterhub singleuser server starts, docjupyter**config.pyfor jupyter related configurations
Note: We added
jupyter**config.pyto extract configurations from the environment variables for some that are not supported to set by environment variables directly. The goal is to make the jupyterhub profile list clear and easy to maintain.
# make the .env file from the example.env
set -a && source .env && set +a
docker compose build
# To run this image as local jupyterlab server for testing
# The default password is set by the `JUPYTER_SERVER_APP_PASSWORD` in the container
docker compose up djlab
Similarly to the singleuser image, we the jupyterhub_config.py in the ~/hub/config directory, you need to modify the c.DockerSpawner.container_image and c.DockerSpawner.environment to configure your singleuser server container.
Note: Local Jupyterhub requires jupyterhub host container to mount
/var/run/docker.sock:/var/run/docker.sockto enable Docker-in-Docker, doc
# make the .env file from the example.env
# OAUTH2 related configurations are not necessary
# since the c.JupyterHub.authenticator_class = "jupyterhub.auth.DummyAuthenticator"
set -a && source .env && set +a
# It takes any random username and password
docker compose up