make JUPYTERHUB_VERSION a config option
and use it as a build arg for the Hub and single-use images
This commit is contained in:
parent
fab261a2dd
commit
65ac9b2a3f
4
.env
4
.env
@ -7,6 +7,7 @@
|
||||
# are not set in the shell environment.
|
||||
|
||||
# To override these values, set the shell environment variables.
|
||||
JUPYTERHUB_VERSION=0.8.0rc2
|
||||
|
||||
# Name of Docker machine
|
||||
DOCKER_MACHINE_NAME=jupyterhub
|
||||
@ -17,6 +18,9 @@ DOCKER_NETWORK_NAME=jupyterhub-network
|
||||
# Single-user Jupyter Notebook server container image
|
||||
DOCKER_NOTEBOOK_IMAGE=jupyter/minimal-notebook:e1677043235c
|
||||
|
||||
# the local image we use, after pinning jupyterhub version
|
||||
LOCAL_NOTEBOOK_IMAGE=jupyterhub-user
|
||||
|
||||
# Notebook directory in the container.
|
||||
# This will be /home/jovyan/work if the default
|
||||
# This directory is stored as a docker volume for each user
|
||||
|
@ -1,6 +1,7 @@
|
||||
# Copyright (c) Jupyter Development Team.
|
||||
# Distributed under the terms of the Modified BSD License.
|
||||
FROM jupyterhub/jupyterhub-onbuild:0.7.2
|
||||
ARG JUPYTERHUB_VERSION
|
||||
FROM jupyterhub/jupyterhub-onbuild:$JUPYTERHUB_VERSION
|
||||
|
||||
# Install dockerspawner, oauth, postgres
|
||||
RUN /opt/conda/bin/conda install -yq psycopg2=2.7 && \
|
||||
|
6
Makefile
6
Makefile
@ -50,7 +50,11 @@ check-files: userlist $(cert_files) secrets/oauth.env secrets/postgres.env
|
||||
pull:
|
||||
docker pull $(DOCKER_NOTEBOOK_IMAGE)
|
||||
|
||||
notebook_image: pull
|
||||
notebook_image: pull singleuser/Dockerfile
|
||||
docker build -t $(LOCAL_NOTEBOOK_IMAGE) \
|
||||
--build-arg JUPYTERHUB_VERSION=$(JUPYTERHUB_VERSION) \
|
||||
--build-arg DOCKER_NOTEBOOK_IMAGE=$(DOCKER_NOTEBOOK_IMAGE) \
|
||||
singleuser
|
||||
|
||||
build: check-files network volumes
|
||||
docker-compose build
|
||||
|
@ -23,6 +23,8 @@ services:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile.jupyterhub
|
||||
args:
|
||||
JUPYTERHUB_VERSION: ${JUPYTERHUB_VERSION}
|
||||
restart: always
|
||||
image: jupyterhub
|
||||
container_name: jupyterhub
|
||||
@ -40,7 +42,7 @@ services:
|
||||
# All containers will join this network
|
||||
DOCKER_NETWORK_NAME: ${DOCKER_NETWORK_NAME}
|
||||
# JupyterHub will spawn this Notebook image for users
|
||||
DOCKER_NOTEBOOK_IMAGE: ${DOCKER_NOTEBOOK_IMAGE}
|
||||
DOCKER_NOTEBOOK_IMAGE: ${LOCAL_NOTEBOOK_IMAGE}
|
||||
# Notebook directory inside user image
|
||||
DOCKER_NOTEBOOK_DIR: ${DOCKER_NOTEBOOK_DIR}
|
||||
# Using this run command (optional)
|
||||
|
4
singleuser/Dockerfile
Normal file
4
singleuser/Dockerfile
Normal file
@ -0,0 +1,4 @@
|
||||
ARG DOCKER_NOTEBOOK_IMAGE
|
||||
FROM $DOCKER_NOTEBOOK_IMAGE
|
||||
ARG JUPYTERHUB_VERSION
|
||||
RUN python3 -m pip install --no-cache jupyterhub==$JUPYTERHUB_VERSION
|
Loading…
Reference in New Issue
Block a user