From 78897a73d442a774ba5dfe67208e3e943ec6d6bc Mon Sep 17 00:00:00 2001 From: Maarten Weyns Date: Wed, 8 Nov 2023 16:05:07 +0100 Subject: [PATCH] Update domserver base to Debian bookworm --- docker/domserver/Dockerfile | 11 +++++++---- docker/domserver/build.sh | 7 +++++-- docker/domserver/configure.sh | 2 +- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/docker/domserver/Dockerfile b/docker/domserver/Dockerfile index 8248cde6..400079d2 100644 --- a/docker/domserver/Dockerfile +++ b/docker/domserver/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:bullseye-slim AS domserver-build +FROM debian:bookworm-slim AS domserver-build LABEL org.opencontainers.image.authors="DOMjudge team " ENV DEBIAN_FRONTEND=noninteractive @@ -12,13 +12,16 @@ RUN apt update \ php-gd php-curl php-mysql php-json php-intl \ php-gmp php-xml php-mbstring \ sudo bsdmainutils ntp libcgroup-dev procps \ - python3-sphinx python3-sphinx-rtd-theme python3-pygments rst2pdf fontconfig python3-yaml \ + python3-venv fontconfig \ texlive-latex-recommended texlive-latex-extra \ - texlive-fonts-recommended texlive-lang-european latexmk \ + texlive-fonts-recommended texlive-lang-european latexmk tex-gyre \ libcurl4-gnutls-dev libjsoncpp-dev libmagic-dev \ enscript lpr ca-certificates \ && rm -rf /var/lib/apt/lists/* +# Use venv to install latest Sphinx. 6.1.0 or higher is required to build DOMjudge docs. +RUN python3 -m venv /venv && . /venv/bin/activate && pip3 install sphinx sphinx-rtd-theme rst2pdf + # Set up user RUN useradd -m domjudge @@ -40,7 +43,7 @@ RUN chmod 700 /scripts/patches.sh && /scripts/patches.sh RUN /domjudge-src/build.sh # Now create an image with the actual build in it -FROM debian:bullseye-slim +FROM debian:bookworm-slim LABEL org.opencontainers.image.authors="DOMjudge team " ENV DEBIAN_FRONTEND=noninteractive \ diff --git a/docker/domserver/build.sh b/docker/domserver/build.sh index cf660477..4ab23958 100755 --- a/docker/domserver/build.sh +++ b/docker/domserver/build.sh @@ -1,9 +1,12 @@ #!/bin/sh -eu +# Use venv to use latest Sphinx. 6.1.0 or higher is required to build DOMjudge docs. +. /venv/bin/activate + cd /domjudge-src/domjudge* chown -R domjudge: . # If we used a local source tarball, it might not have been built yet -sudo -u domjudge make dist +sudo -u domjudge sh -c '. /venv/bin/activate && make dist' sudo -u domjudge ./configure -with-baseurl=http://dj.chipcie.ch.tudelft.nl/ # Passwords should not be included in the built image. We create empty files here to prevent passwords from being generated. @@ -25,5 +28,5 @@ then rm /opt/domjudge/domserver/webapp/.env.local /opt/domjudge/domserver/webapp/.env.local.php fi -sudo -u domjudge make docs +sudo -u domjudge sh -c '. /venv/bin/activate && make docs' make install-docs diff --git a/docker/domserver/configure.sh b/docker/domserver/configure.sh index 55684046..5bd82143 100644 --- a/docker/domserver/configure.sh +++ b/docker/domserver/configure.sh @@ -23,7 +23,7 @@ done # Configure php -php_folder=$(echo "/etc/php/7."?"/") +php_folder=$(echo "/etc/php/8."?"/") php_version=$(basename "$php_folder") if [ ! -d "$php_folder" ]