Skip to content

Commit 65ac9b2

Browse files
committed
make JUPYTERHUB_VERSION a config option
and use it as a build arg for the Hub and single-use images
1 parent fab261a commit 65ac9b2

File tree

5 files changed

+18
-3
lines changed

5 files changed

+18
-3
lines changed

.env

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
# are not set in the shell environment.
88

99
# To override these values, set the shell environment variables.
10+
JUPYTERHUB_VERSION=0.8.0rc2
1011

1112
# Name of Docker machine
1213
DOCKER_MACHINE_NAME=jupyterhub
@@ -17,6 +18,9 @@ DOCKER_NETWORK_NAME=jupyterhub-network
1718
# Single-user Jupyter Notebook server container image
1819
DOCKER_NOTEBOOK_IMAGE=jupyter/minimal-notebook:e1677043235c
1920

21+
# the local image we use, after pinning jupyterhub version
22+
LOCAL_NOTEBOOK_IMAGE=jupyterhub-user
23+
2024
# Notebook directory in the container.
2125
# This will be /home/jovyan/work if the default
2226
# This directory is stored as a docker volume for each user

Dockerfile.jupyterhub

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Copyright (c) Jupyter Development Team.
22
# Distributed under the terms of the Modified BSD License.
3-
FROM jupyterhub/jupyterhub-onbuild:0.7.2
3+
ARG JUPYTERHUB_VERSION
4+
FROM jupyterhub/jupyterhub-onbuild:$JUPYTERHUB_VERSION
45

56
# Install dockerspawner, oauth, postgres
67
RUN /opt/conda/bin/conda install -yq psycopg2=2.7 && \

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,11 @@ check-files: userlist $(cert_files) secrets/oauth.env secrets/postgres.env
5050
pull:
5151
docker pull $(DOCKER_NOTEBOOK_IMAGE)
5252

53-
notebook_image: pull
53+
notebook_image: pull singleuser/Dockerfile
54+
docker build -t $(LOCAL_NOTEBOOK_IMAGE) \
55+
--build-arg JUPYTERHUB_VERSION=$(JUPYTERHUB_VERSION) \
56+
--build-arg DOCKER_NOTEBOOK_IMAGE=$(DOCKER_NOTEBOOK_IMAGE) \
57+
singleuser
5458

5559
build: check-files network volumes
5660
docker-compose build

docker-compose.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ services:
2323
build:
2424
context: .
2525
dockerfile: Dockerfile.jupyterhub
26+
args:
27+
JUPYTERHUB_VERSION: ${JUPYTERHUB_VERSION}
2628
restart: always
2729
image: jupyterhub
2830
container_name: jupyterhub
@@ -40,7 +42,7 @@ services:
4042
# All containers will join this network
4143
DOCKER_NETWORK_NAME: ${DOCKER_NETWORK_NAME}
4244
# JupyterHub will spawn this Notebook image for users
43-
DOCKER_NOTEBOOK_IMAGE: ${DOCKER_NOTEBOOK_IMAGE}
45+
DOCKER_NOTEBOOK_IMAGE: ${LOCAL_NOTEBOOK_IMAGE}
4446
# Notebook directory inside user image
4547
DOCKER_NOTEBOOK_DIR: ${DOCKER_NOTEBOOK_DIR}
4648
# Using this run command (optional)

singleuser/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
ARG DOCKER_NOTEBOOK_IMAGE
2+
FROM $DOCKER_NOTEBOOK_IMAGE
3+
ARG JUPYTERHUB_VERSION
4+
RUN python3 -m pip install --no-cache jupyterhub==$JUPYTERHUB_VERSION

0 commit comments

Comments
 (0)