Skip to content

[wip, save for 6.0] bump base image to ubuntu 24.04 (Python 3.12) #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/watch-dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
- uses: actions/setup-python@v5
with:
# this should match the Python version in base/Dockerfile
python-version: "3.10"
python-version: "3.12"
- name: install pip-tools
run: |
pip install --upgrade pip
Expand Down
22 changes: 17 additions & 5 deletions base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,18 @@
#
# docker run -v $PWD:/srv/jupyterhub -t quay.io/jupyterhub/jupyterhub

ARG BASE_IMAGE=ubuntu:22.04
# note: if changing BASE_IMAGE changes the Python version,
# update version in .github/workflows/watch-dependencies.yaml
ARG BASE_IMAGE=ubuntu:24.04

######################################################################
# Ensure we have wheels for JupyterHub and all dependencies,
# some are platform specific
FROM $BASE_IMAGE AS wheel-builder

ENV DEBIAN_FRONTEND=noninteractive
ENV DEBIAN_FRONTEND=noninteractive \
VIRTUAL_ENV=/tmp/build \
PATH=/srv/venv/bin:${PATH}

RUN apt-get update -qq \
&& apt-get install -yqq --no-install-recommends \
Expand All @@ -35,7 +39,8 @@ RUN apt-get update -qq \
python3-pip \
python3-pycurl \
python3-venv \
&& python3 -m pip install --no-cache-dir --upgrade setuptools pip build wheel
&& python3 -m venv ${VIRTUAL_ENV} \
&& ${VIRTUAL_ENV}/bin/python3 -m pip install --upgrade setuptools pip build wheel

WORKDIR /src/jupyterhub
COPY requirements.txt /src/jupyterhub/
Expand All @@ -54,7 +59,9 @@ ENV DEBIAN_FRONTEND=noninteractive \
LC_ALL=en_US.UTF-8 \
LANG=en_US.UTF-8 \
LANGUAGE=en_US.UTF-8 \
PYTHONDONTWRITEBYTECODE=1
PYTHONDONTWRITEBYTECODE=1 \
VIRTUAL_ENV=/srv/venv \
PATH=/srv/venv/bin:${PATH}

EXPOSE 8000

Expand All @@ -72,6 +79,7 @@ RUN apt-get update -qq \
python-is-python3 \
python3-pip \
python3-pycurl \
python3-venv \
nodejs \
npm \
&& locale-gen $LC_ALL \
Expand All @@ -80,8 +88,12 @@ RUN apt-get update -qq \
&& rm -rf /var/lib/apt/lists/* /var/log/* /var/tmp/* ~/.npm
# install the wheels we built in the previous stage
RUN --mount=type=cache,from=wheel-builder,source=/src/jupyterhub/wheelhouse,target=/tmp/wheelhouse \
# first make an env
# --system-site-packages lets us use pycurl from apt
python3 -m venv --system-site-packages ${VIRTUAL_ENV} \
# from here, `python3` is in the venv
# always make sure pip is up to date!
python3 -m pip install --no-compile --no-cache-dir --upgrade setuptools pip \
&& python3 -m pip install --no-compile --no-cache-dir --upgrade setuptools pip \
&& python3 -m pip install --no-compile --no-cache-dir /tmp/wheelhouse/*

CMD ["jupyterhub"]
Loading