Skip to content

Commit c02a505

Browse files
authored
Merge pull request #47 from minrk/08
Use JUPYTERHUB_VERSION as a build arg
2 parents 9ab7441 + 9d50233 commit c02a505

File tree

5 files changed

+23
-8
lines changed

5 files changed

+23
-8
lines changed

.env

Lines changed: 5 additions & 1 deletion
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.0
1011

1112
# Name of Docker machine
1213
DOCKER_MACHINE_NAME=jupyterhub
@@ -15,7 +16,10 @@ DOCKER_MACHINE_NAME=jupyterhub
1516
DOCKER_NETWORK_NAME=jupyterhub-network
1617

1718
# Single-user Jupyter Notebook server container image
18-
DOCKER_NOTEBOOK_IMAGE=jupyter/scipy-notebook:8f56e3c47fec
19+
DOCKER_NOTEBOOK_IMAGE=jupyter/minimal-notebook:e1677043235c
20+
21+
# the local image we use, after pinning jupyterhub version
22+
LOCAL_NOTEBOOK_IMAGE=jupyterhub-user
1923

2024
# Notebook directory in the container.
2125
# This will be /home/jovyan/work if the default

Dockerfile.jupyterhub

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
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
6-
RUN /opt/conda/bin/conda install psycopg2=2.7 && \
7+
RUN /opt/conda/bin/conda install -yq psycopg2=2.7 && \
78
/opt/conda/bin/conda clean -tipsy && \
8-
/opt/conda/bin/pip install \
9-
oauthenticator==0.6.* \
10-
dockerspawner==0.8.*
9+
/opt/conda/bin/pip install --no-cache-dir \
10+
oauthenticator==0.7.* \
11+
dockerspawner==0.9.*
1112

1213
# Copy TLS certificate and key
1314
ENV SSL_CERT /srv/jupyterhub/secrets/jupyterhub.crt

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)