Skip to content

Commit a877234

Browse files
committed
Switch the docker build to Ubuntu 26.
The `DBD::MariaDB` package is provided by the Ubuntu `libdb-mariadb-perl` package again. So that does not need to be installed from cpan anymore. Also change the mariadb docker image to version 11.8 to match the version used by Ubuntu 26. The `libio-compress-perl` Ubuntu package is a dependency of the `Archive::Zip::SimpleZip` Perl package that is needed since the Perl packages it provides fail to build when installed from cpan. It may be that they just need some other build dependency, but it is better to install the Ubuntu packages anyway. Several dependencies of the Perl `Net::SAML2` package were added to speed up the build some and avoid these being installed from cpan. Remove `install` from the `cpanm` command. That isn't a command or option for the `cpanm` command and results in the `install` perl package being installed which isn't needed. The `pgfsys-dvisvgm-bbox-fix.patch` file is not needed for Ubuntu 26. Its changes are included in upstream file installed on the system. Fix the comments about executing `docker compose`. That is no longer executed as `docker-compose`. Update the `docker-entrypoint.sh` to use `libpapers2`. The `libpapers1` package no longer exists. The `newgrp` command used in the `docker-entrypoint.sh` script is no longer is installed by default. The `util-linux-extra` package is needed for that.
1 parent a99f124 commit a877234

5 files changed

Lines changed: 50 additions & 27 deletions

File tree

Dockerfile

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ RUN echo Cloning branch $PG_BRANCH branch from $PG_GIT_URL \
3030

3131
# We need to change FROM before setting the ENV variables.
3232

33-
FROM ubuntu:24.04
33+
FROM ubuntu:26.04
3434

3535
ENV WEBWORK_URL=/webwork2 \
3636
WEBWORK_ROOT_URL=http://localhost:8080 \
@@ -79,12 +79,17 @@ RUN apt-get update \
7979
libclass-tiny-antlers-perl \
8080
libclass-tiny-perl \
8181
libcpanel-json-xs-perl \
82+
libcrypt-dev \
8283
libcrypt-jwt-perl \
84+
libcrypt-openssl-x509-perl \
8385
libcryptx-perl \
8486
libdata-dump-perl \
8587
libdata-structure-util-perl \
8688
libdatetime-perl \
89+
libdatetime-format-xsd-perl \
90+
libdatetime-hires-perl \
8791
libdbd-mysql-perl \
92+
libdbd-mariadb-perl \
8893
libdevel-checklib-perl \
8994
libemail-address-xs-perl \
9095
libemail-date-format-perl \
@@ -98,12 +103,14 @@ RUN apt-get update \
98103
libfile-copy-recursive-perl \
99104
libfile-find-rule-perl-perl \
100105
libfile-sharedir-install-perl \
106+
libfile-slurper-perl \
101107
libfuture-asyncawait-perl \
102108
libgd-barcode-perl \
103109
libgd-perl \
104110
libhtml-scrubber-perl \
105111
libhtml-template-perl \
106112
libhttp-async-perl \
113+
libio-compress-perl \
107114
libiterator-perl \
108115
libiterator-util-perl \
109116
liblocale-maketext-lexicon-perl \
@@ -117,6 +124,11 @@ RUN apt-get update \
117124
libmodule-pluggable-perl \
118125
libmojolicious-perl \
119126
libmojolicious-plugin-renderfile-perl \
127+
libmoose-perl \
128+
libmoosex-types-common-perl \
129+
libmoosex-types-datetime-perl \
130+
libmoosex-types-perl \
131+
libmoosex-types-uri-perl \
120132
libnet-https-nb-perl \
121133
libnet-ip-perl \
122134
libnet-ldap-perl \
@@ -130,6 +142,7 @@ RUN apt-get update \
130142
libpod-wsdl-perl \
131143
libsoap-lite-perl \
132144
libsql-abstract-perl \
145+
libssl-dev \
133146
libstring-shellquote-perl \
134147
libsub-uplevel-perl \
135148
libsvg-perl \
@@ -145,9 +158,12 @@ RUN apt-get update \
145158
libtext-csv-perl \
146159
libthrowable-perl \
147160
libtimedate-perl \
161+
libtypes-serialiser-perl \
148162
libuniversal-can-perl \
149163
libuniversal-isa-perl \
164+
liburi-encode-perl \
150165
libuuid-tiny-perl \
166+
libxml-generator-perl \
151167
libxml-parser-easytree-perl \
152168
libxml-parser-perl \
153169
libxml-semanticdiff-perl \
@@ -173,6 +189,8 @@ RUN apt-get update \
173189
texlive-science \
174190
texlive-xetex \
175191
tzdata \
192+
util-linux-extra \
193+
zlib1g-dev \
176194
zip $ADDITIONAL_BASE_IMAGE_PACKAGES \
177195
&& curl -fsSL https://deb.nodesource.com/setup_24.x | bash - \
178196
&& apt-get install -y --no-install-recommends --no-install-suggests nodejs \
@@ -182,8 +200,7 @@ RUN apt-get update \
182200
# ==================================================================
183201
# Phase 4 - Install additional Perl modules from CPAN that are not packaged for Ubuntu or are outdated in Ubuntu.
184202

185-
RUN cpanm install -n \
186-
DBD::MariaDB \
203+
RUN cpanm -n \
187204
Perl::Tidy@20240903 \
188205
Archive::Zip::SimpleZip \
189206
Net::SAML2 \
@@ -212,9 +229,6 @@ COPY --from=base /opt/base/pg $APP_ROOT/pg
212229
# 6. Install third party javascript files.
213230
# 7. Apply patches
214231

215-
# Patch files that are applied below
216-
COPY docker-config/pgfsys-dvisvmg-bbox-fix.patch /tmp
217-
218232
RUN echo "PATH=$PATH:$APP_ROOT/webwork2/bin" >> /root/.bashrc \
219233
&& mkdir /run/webwork2 /etc/ssl/local \
220234
&& cd $APP_ROOT/webwork2/ \
@@ -224,14 +238,12 @@ RUN echo "PATH=$PATH:$APP_ROOT/webwork2/bin" >> /root/.bashrc \
224238
&& /usr/sbin/locale-gen \
225239
&& echo "locales locales/default_environment_locale select en_US.UTF-8\ndebconf debconf/frontend select Noninteractive" > /tmp/preseed.txt \
226240
&& debconf-set-selections /tmp/preseed.txt \
227-
&& rm /etc/localtime /etc/timezone && echo "Etc/UTC" > /etc/timezone \
241+
&& rm -f /etc/localtime /etc/timezone && echo "Etc/UTC" > /etc/timezone \
228242
&& dpkg-reconfigure -f noninteractive tzdata \
229243
&& cd $WEBWORK_ROOT/htdocs \
230244
&& npm install \
231245
&& cd $PG_ROOT/htdocs \
232-
&& npm install \
233-
&& patch -p1 -d / < /tmp/pgfsys-dvisvmg-bbox-fix.patch \
234-
&& rm /tmp/pgfsys-dvisvmg-bbox-fix.patch
246+
&& npm install
235247

236248
# ==================================================================
237249
# Phase 7 - Final setup and prepare docker-entrypoint.sh

DockerfileStage1

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This is the Stage 1 Dockerfile, which builds a base OS image (webwork-base)
22
# on top of which the WeBWorK parts will be installed by the Stage 2 Dockerfile.
33

4-
FROM ubuntu:24.04
4+
FROM ubuntu:26.04
55

66
# ==================================================================
77
# Phase 1 - Set base OS image install stage ENV variables
@@ -41,12 +41,17 @@ RUN apt-get update \
4141
libclass-tiny-antlers-perl \
4242
libclass-tiny-perl \
4343
libcpanel-json-xs-perl \
44+
libcrypt-dev \
4445
libcrypt-jwt-perl \
46+
libcrypt-openssl-x509-perl \
4547
libcryptx-perl \
4648
libdata-dump-perl \
4749
libdata-structure-util-perl \
4850
libdatetime-perl \
51+
libdatetime-format-xsd-perl \
52+
libdatetime-hires-perl \
4953
libdbd-mysql-perl \
54+
libdbd-mariadb-perl \
5055
libdevel-checklib-perl \
5156
libemail-address-xs-perl \
5257
libemail-date-format-perl \
@@ -60,16 +65,17 @@ RUN apt-get update \
6065
libfile-copy-recursive-perl \
6166
libfile-find-rule-perl-perl \
6267
libfile-sharedir-install-perl \
68+
libfile-slurper-perl \
6369
libfuture-asyncawait-perl \
6470
libgd-barcode-perl \
6571
libgd-perl \
6672
libhtml-scrubber-perl \
6773
libhtml-template-perl \
6874
libhttp-async-perl \
75+
libio-compress-perl \
6976
libiterator-perl \
7077
libiterator-util-perl \
7178
liblocale-maketext-lexicon-perl \
72-
libmariadb-dev \
7379
libmath-random-secure-perl \
7480
libmime-base32-perl \
7581
libmime-tools-perl \
@@ -79,6 +85,11 @@ RUN apt-get update \
7985
libmodule-pluggable-perl \
8086
libmojolicious-perl \
8187
libmojolicious-plugin-renderfile-perl \
88+
libmoose-perl \
89+
libmoosex-types-common-perl \
90+
libmoosex-types-datetime-perl \
91+
libmoosex-types-perl \
92+
libmoosex-types-uri-perl \
8293
libnet-https-nb-perl \
8394
libnet-ip-perl \
8495
libnet-ldap-perl \
@@ -92,6 +103,7 @@ RUN apt-get update \
92103
libpod-wsdl-perl \
93104
libsoap-lite-perl \
94105
libsql-abstract-perl \
106+
libssl-dev \
95107
libstring-shellquote-perl \
96108
libsub-uplevel-perl \
97109
libsvg-perl \
@@ -107,9 +119,12 @@ RUN apt-get update \
107119
libtext-csv-perl \
108120
libthrowable-perl \
109121
libtimedate-perl \
122+
libtypes-serialiser-perl \
110123
libuniversal-can-perl \
111124
libuniversal-isa-perl \
125+
liburi-encode-perl \
112126
libuuid-tiny-perl \
127+
libxml-generator-perl \
113128
libxml-parser-easytree-perl \
114129
libxml-parser-perl \
115130
libxml-semanticdiff-perl \
@@ -135,6 +150,8 @@ RUN apt-get update \
135150
texlive-science \
136151
texlive-xetex \
137152
tzdata \
153+
util-linux-extra \
154+
zlib1g-dev \
138155
zip $ADDITIONAL_BASE_IMAGE_PACKAGES \
139156
&& curl -fsSL https://deb.nodesource.com/setup_24.x | bash - \
140157
&& apt-get install -y --no-install-recommends --no-install-suggests nodejs \
@@ -144,8 +161,7 @@ RUN apt-get update \
144161
# ==================================================================
145162
# Phase 3 - Install additional Perl modules from CPAN that are not packaged for Ubuntu or are outdated in Ubuntu.
146163

147-
RUN cpanm install -n \
148-
DBD::MariaDB \
164+
RUN cpanm -n \
149165
Perl::Tidy@20240903 \
150166
Archive::Zip::SimpleZip \
151167
Net::SAML2 \

DockerfileStage2

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,6 @@ COPY --from=base /opt/base/pg $APP_ROOT/pg
7373
# 6. Install third party javascript files.
7474
# 7. Apply patches
7575

76-
# Patch files that are applied below
77-
COPY docker-config/pgfsys-dvisvmg-bbox-fix.patch /tmp
78-
7976
RUN echo "PATH=$PATH:$APP_ROOT/webwork2/bin" >> /root/.bashrc \
8077
&& mkdir /run/webwork2 /etc/ssl/local \
8178
&& cd $APP_ROOT/webwork2/ \
@@ -85,14 +82,12 @@ RUN echo "PATH=$PATH:$APP_ROOT/webwork2/bin" >> /root/.bashrc \
8582
&& /usr/sbin/locale-gen \
8683
&& echo "locales locales/default_environment_locale select en_US.UTF-8\ndebconf debconf/frontend select Noninteractive" > /tmp/preseed.txt \
8784
&& debconf-set-selections /tmp/preseed.txt \
88-
&& rm /etc/localtime /etc/timezone && echo "Etc/UTC" > /etc/timezone \
85+
&& rm -f /etc/localtime /etc/timezone && echo "Etc/UTC" > /etc/timezone \
8986
&& dpkg-reconfigure -f noninteractive tzdata \
9087
&& cd $WEBWORK_ROOT/htdocs \
9188
&& npm install \
9289
&& cd $PG_ROOT/htdocs \
93-
&& npm install \
94-
&& patch -p1 -d / < /tmp/pgfsys-dvisvmg-bbox-fix.patch \
95-
&& rm /tmp/pgfsys-dvisvmg-bbox-fix.patch
90+
&& npm install
9691

9792
# ==================================================================
9893
# Phase 5 - Final setup and prepare docker-entrypoint.sh

docker-config/docker-compose.dist.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
db:
3-
image: mariadb:10.11
3+
image: mariadb:11.8
44

55
# Set a fixed container name, so it does not depend on the directory name
66
container_name: webwork2_db_1
@@ -93,12 +93,12 @@ services:
9393
#- WEBWORK2_BRANCH=develop
9494
#- PG_BRANCH=develop
9595

96-
# If you would like a 1 stage build process comment out the next line, and just run "docker-compose build".
96+
# If you would like a 1 stage build process comment out the next line, and just run "docker compose build".
9797
dockerfile: DockerfileStage2
9898
# For the 2 stage build process run
9999
# docker build --tag webwork-base:forWW221 -f DockerfileStage1 .
100100
# and then
101-
# docker-compose build
101+
# docker compose build
102102
# When rebuilding to get updated images add the "--no-cache" option to both commands.
103103
# You can add something like
104104
# --build-arg ADDITIONAL_BASE_IMAGE_PACKAGES="nano less"

docker-config/docker-entrypoint.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ if [ "$SYSTEM_TIMEZONE" != "UTC" ]; then
3030
fi
3131

3232
# Modify default papersize based on environment variable PAPERSIZE
33-
echo "Setting libpaper1 papersize to $PAPERSIZE"
34-
echo "libpaper1 libpaper/defaultpaper select $PAPERSIZE\nlibpaper1:amd64 libpaper/defaultpaper select $PAPERSIZE\ndebconf debconf/frontend select Noninteractive" > /tmp/preseed.txt
33+
echo "Setting libpaper2 papersize to $PAPERSIZE"
34+
echo "libpaper2 libpaper/defaultpaper select $PAPERSIZE\nlibpaper2:amd64 libpaper/defaultpaper select $PAPERSIZE\ndebconf debconf/frontend select Noninteractive" > /tmp/preseed.txt
3535
debconf-set-selections /tmp/preseed.txt
36-
dpkg-reconfigure -f noninteractive libpaper1
36+
dpkg-reconfigure -f noninteractive libpaper2
3737

3838
# Install some extra packages
3939
if [ "$ADD_APT_PACKAGES" != "0" ]; then

0 commit comments

Comments
 (0)