Merge pull request #47 from minrk/08
Use JUPYTERHUB_VERSION as a build arg
This commit is contained in:
commit
c02a505d5b
6
.env
6
.env
@ -7,6 +7,7 @@
|
|||||||
# are not set in the shell environment.
|
# are not set in the shell environment.
|
||||||
|
|
||||||
# To override these values, set the shell environment variables.
|
# To override these values, set the shell environment variables.
|
||||||
|
JUPYTERHUB_VERSION=0.8.0
|
||||||
|
|
||||||
# Name of Docker machine
|
# Name of Docker machine
|
||||||
DOCKER_MACHINE_NAME=jupyterhub
|
DOCKER_MACHINE_NAME=jupyterhub
|
||||||
@ -15,7 +16,10 @@ DOCKER_MACHINE_NAME=jupyterhub
|
|||||||
DOCKER_NETWORK_NAME=jupyterhub-network
|
DOCKER_NETWORK_NAME=jupyterhub-network
|
||||||
|
|
||||||
# Single-user Jupyter Notebook server container image
|
# Single-user Jupyter Notebook server container image
|
||||||
DOCKER_NOTEBOOK_IMAGE=jupyter/scipy-notebook:8f56e3c47fec
|
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.
|
# Notebook directory in the container.
|
||||||
# This will be /home/jovyan/work if the default
|
# This will be /home/jovyan/work if the default
|
||||||
|
@ -1,13 +1,14 @@
|
|||||||
# Copyright (c) Jupyter Development Team.
|
# Copyright (c) Jupyter Development Team.
|
||||||
# Distributed under the terms of the Modified BSD License.
|
# 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
|
# Install dockerspawner, oauth, postgres
|
||||||
RUN /opt/conda/bin/conda install psycopg2=2.7 && \
|
RUN /opt/conda/bin/conda install -yq psycopg2=2.7 && \
|
||||||
/opt/conda/bin/conda clean -tipsy && \
|
/opt/conda/bin/conda clean -tipsy && \
|
||||||
/opt/conda/bin/pip install \
|
/opt/conda/bin/pip install --no-cache-dir \
|
||||||
oauthenticator==0.6.* \
|
oauthenticator==0.7.* \
|
||||||
dockerspawner==0.8.*
|
dockerspawner==0.9.*
|
||||||
|
|
||||||
# Copy TLS certificate and key
|
# Copy TLS certificate and key
|
||||||
ENV SSL_CERT /srv/jupyterhub/secrets/jupyterhub.crt
|
ENV SSL_CERT /srv/jupyterhub/secrets/jupyterhub.crt
|
||||||
|
6
Makefile
6
Makefile
@ -50,7 +50,11 @@ check-files: userlist $(cert_files) secrets/oauth.env secrets/postgres.env
|
|||||||
pull:
|
pull:
|
||||||
docker pull $(DOCKER_NOTEBOOK_IMAGE)
|
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
|
build: check-files network volumes
|
||||||
docker-compose build
|
docker-compose build
|
||||||
|
@ -23,6 +23,8 @@ services:
|
|||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: Dockerfile.jupyterhub
|
dockerfile: Dockerfile.jupyterhub
|
||||||
|
args:
|
||||||
|
JUPYTERHUB_VERSION: ${JUPYTERHUB_VERSION}
|
||||||
restart: always
|
restart: always
|
||||||
image: jupyterhub
|
image: jupyterhub
|
||||||
container_name: jupyterhub
|
container_name: jupyterhub
|
||||||
@ -40,7 +42,7 @@ services:
|
|||||||
# All containers will join this network
|
# All containers will join this network
|
||||||
DOCKER_NETWORK_NAME: ${DOCKER_NETWORK_NAME}
|
DOCKER_NETWORK_NAME: ${DOCKER_NETWORK_NAME}
|
||||||
# JupyterHub will spawn this Notebook image for users
|
# 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
|
# Notebook directory inside user image
|
||||||
DOCKER_NOTEBOOK_DIR: ${DOCKER_NOTEBOOK_DIR}
|
DOCKER_NOTEBOOK_DIR: ${DOCKER_NOTEBOOK_DIR}
|
||||||
# Using this run command (optional)
|
# 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