Skip to content

Commit 53b67e3

Browse files
tossy310vmcj
authored andcommitted
Use bookworm for building Docker image (Fixes #154)
* Use Python venv to build domserver because Sphinx version should be 6.1.0 or higher to avoid a build issue. * Use PHP 8.x because it's default in Debian. * Use libcgoup2 instead of libcgroup1, which is no longer available.
1 parent 4e9e1b5 commit 53b67e3

File tree

5 files changed

+16
-10
lines changed

5 files changed

+16
-10
lines changed

docker/domserver/Dockerfile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM debian:bullseye-slim AS domserver-build
1+
FROM debian:bookworm-slim AS domserver-build
22
LABEL org.opencontainers.image.authors="DOMjudge team <[email protected]>"
33

44
ENV DEBIAN_FRONTEND=noninteractive
@@ -12,13 +12,16 @@ RUN apt update \
1212
php-gd php-curl php-mysql php-json php-intl \
1313
php-gmp php-xml php-mbstring \
1414
sudo bsdmainutils ntp libcgroup-dev procps \
15-
python3-sphinx python3-sphinx-rtd-theme python3-pygments rst2pdf fontconfig python3-yaml \
15+
python3-venv fontconfig \
1616
texlive-latex-recommended texlive-latex-extra \
17-
texlive-fonts-recommended texlive-lang-european latexmk \
17+
texlive-fonts-recommended texlive-lang-european latexmk tex-gyre \
1818
libcurl4-gnutls-dev libjsoncpp-dev libmagic-dev \
1919
enscript lpr ca-certificates \
2020
&& rm -rf /var/lib/apt/lists/*
2121

22+
# Use venv to install latest Sphinx. 6.1.0 or higher is required to build DOMjudge docs.
23+
RUN python3 -m venv /venv && . /venv/bin/activate && pip3 install sphinx sphinx-rtd-theme rst2pdf
24+
2225
# Set up user
2326
RUN useradd -m domjudge
2427

@@ -35,7 +38,7 @@ COPY domserver/build.sh /domjudge-src/build.sh
3538
RUN /domjudge-src/build.sh
3639

3740
# Now create an image with the actual build in it
38-
FROM debian:bullseye-slim
41+
FROM debian:bookworm-slim
3942
LABEL org.opencontainers.image.authors="DOMjudge team <[email protected]>"
4043

4144
ENV DEBIAN_FRONTEND=noninteractive \

docker/domserver/build.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
#!/bin/sh -eu
22

3+
# Use venv to use latest Sphinx. 6.1.0 or higher is required to build DOMjudge docs.
4+
. /venv/bin/activate
5+
36
cd /domjudge-src/domjudge*
47
chown -R domjudge: .
58
# If we used a local source tarball, it might not have been built yet
6-
sudo -u domjudge make dist
9+
sudo -u domjudge sh -c '. /venv/bin/activate && make dist'
710
sudo -u domjudge ./configure -with-baseurl=http://localhost/
811

912
# 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
2528
rm /opt/domjudge/domserver/webapp/.env.local /opt/domjudge/domserver/webapp/.env.local.php
2629
fi
2730

28-
sudo -u domjudge make docs
31+
sudo -u domjudge sh -c '. /venv/bin/activate && make docs'
2932
make install-docs

docker/domserver/configure.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ done
2323

2424
# Configure php
2525

26-
php_folder=$(echo "/etc/php/7."?"/")
26+
php_folder=$(echo "/etc/php/8."?"/")
2727
php_version=$(basename "$php_folder")
2828

2929
if [ ! -d "$php_folder" ]

docker/judgehost/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM debian:bullseye
1+
FROM debian:bookworm
22
LABEL org.opencontainers.image.authors="DOMjudge team <[email protected]>"
33

44
ENV DEBIAN_FRONTEND=noninteractive \
@@ -14,7 +14,7 @@ ENV DEBIAN_FRONTEND=noninteractive \
1414
RUN apt update \
1515
&& apt install --no-install-recommends --no-install-suggests -y \
1616
dumb-init \
17-
acl zip unzip supervisor sudo procps libcgroup1 \
17+
acl zip unzip supervisor sudo procps libcgroup2 \
1818
php-cli php-zip php-gd php-curl php-mysql php-json \
1919
php-gmp php-xml php-mbstring python3 \
2020
gcc g++ default-jre-headless default-jdk ghc fp-compiler \

docker/judgehost/Dockerfile.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM debian:bullseye-slim
1+
FROM debian:bookworm-slim
22
LABEL org.opencontainers.image.authors="DOMjudge team <[email protected]>"
33

44
ENV DEBIAN_FRONTEND=noninteractive

0 commit comments

Comments
 (0)