Skip to content

Commit

Permalink
Merge pull request openwebwork#2449 from openwebwork/docker-build-ubu…
Browse files Browse the repository at this point in the history
…ntu-24.04

Update the docker build to Ubuntu 24.04.
  • Loading branch information
pstaabp authored Aug 6, 2024
2 parents b6322b5 + 574ee82 commit d2bb66e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 18 deletions.
10 changes: 2 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ RUN echo Cloning branch $PG_BRANCH branch from $PG_GIT_URL \

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

FROM ubuntu:22.04
FROM ubuntu:24.04

ENV WEBWORK_URL=/webwork2 \
WEBWORK_ROOT_URL=http://localhost::8080 \
Expand Down Expand Up @@ -110,8 +110,6 @@ RUN apt-get update \
libjson-perl \
libjson-xs-perl \
liblocale-maketext-lexicon-perl \
libmail-sender-perl \
libmail-sender-perl \
libmariadb-dev \
libmath-random-secure-perl \
libmime-base32-perl \
Expand All @@ -120,6 +118,7 @@ RUN apt-get update \
libminion-perl \
libmodule-build-perl \
libmodule-pluggable-perl \
libmojolicious-perl \
libmojolicious-plugin-renderfile-perl \
libnet-https-nb-perl \
libnet-ip-perl \
Expand Down Expand Up @@ -189,8 +188,6 @@ RUN apt-get update \
RUN cpanm install -n \
Statistics::R::IO \
DBD::MariaDB \
Mojolicious \
Mojo::[email protected] \
Perl::Tidy@20220613 \
Archive::Zip::SimpleZip \
&& rm -fr ./cpanm /root/.cpanm /tmp/*
Expand Down Expand Up @@ -219,7 +216,6 @@ COPY --from=base /opt/base/pg $APP_ROOT/pg
# 7. Apply patches

# Patch files that are applied below
COPY docker-config/imagemagick-allow-pdf-read.patch /tmp
COPY docker-config/pgfsys-dvisvmg-bbox-fix.patch /tmp

RUN echo "PATH=$PATH:$APP_ROOT/webwork2/bin" >> /root/.bashrc \
Expand All @@ -237,8 +233,6 @@ RUN echo "PATH=$PATH:$APP_ROOT/webwork2/bin" >> /root/.bashrc \
&& npm install \
&& cd $PG_ROOT/htdocs \
&& npm install \
&& patch -p1 -d / < /tmp/imagemagick-allow-pdf-read.patch \
&& rm /tmp/imagemagick-allow-pdf-read.patch \
&& patch -p1 -d / < /tmp/pgfsys-dvisvmg-bbox-fix.patch \
&& rm /tmp/pgfsys-dvisvmg-bbox-fix.patch

Expand Down
7 changes: 2 additions & 5 deletions DockerfileStage1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This is the Stage 1 Dockerfile, which builds a base OS image (webwork-base)
# on top of which the WeBWorK parts will be installed by the Stage 2 Dockerfile.

FROM ubuntu:22.04
FROM ubuntu:24.04

# ==================================================================
# Phase 1 - Set base OS image install stage ENV variables
Expand Down Expand Up @@ -72,8 +72,6 @@ RUN apt-get update \
libjson-perl \
libjson-xs-perl \
liblocale-maketext-lexicon-perl \
libmail-sender-perl \
libmail-sender-perl \
libmariadb-dev \
libmath-random-secure-perl \
libmime-base32-perl \
Expand All @@ -82,6 +80,7 @@ RUN apt-get update \
libminion-perl \
libmodule-build-perl \
libmodule-pluggable-perl \
libmojolicious-perl \
libmojolicious-plugin-renderfile-perl \
libnet-https-nb-perl \
libnet-ip-perl \
Expand Down Expand Up @@ -151,8 +150,6 @@ RUN apt-get update \
RUN cpanm install -n \
Statistics::R::IO \
DBD::MariaDB \
Mojolicious \
Mojo::[email protected] \
Perl::Tidy@20220613 \
Archive::Zip::SimpleZip \
&& rm -fr ./cpanm /root/.cpanm /tmp/*
Expand Down
5 changes: 1 addition & 4 deletions DockerfileStage2
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ RUN echo Cloning branch $PG_BRANCH branch from $PG_GIT_URL \

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

FROM webwork-base:forWW218
FROM webwork-base:forWW219

ENV WEBWORK_URL=/webwork2 \
WEBWORK_ROOT_URL=http://localhost::8080 \
Expand Down Expand Up @@ -74,7 +74,6 @@ COPY --from=base /opt/base/pg $APP_ROOT/pg
# 7. Apply patches

# Patch files that are applied below
COPY docker-config/imagemagick-allow-pdf-read.patch /tmp
COPY docker-config/pgfsys-dvisvmg-bbox-fix.patch /tmp

RUN echo "PATH=$PATH:$APP_ROOT/webwork2/bin" >> /root/.bashrc \
Expand All @@ -92,8 +91,6 @@ RUN echo "PATH=$PATH:$APP_ROOT/webwork2/bin" >> /root/.bashrc \
&& npm install \
&& cd $PG_ROOT/htdocs \
&& npm install \
&& patch -p1 -d / < /tmp/imagemagick-allow-pdf-read.patch \
&& rm /tmp/imagemagick-allow-pdf-read.patch \
&& patch -p1 -d / < /tmp/pgfsys-dvisvmg-bbox-fix.patch \
&& rm /tmp/pgfsys-dvisvmg-bbox-fix.patch

Expand Down
2 changes: 1 addition & 1 deletion docker-config/docker-compose.dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ services:
# If you would like a 1 stage build process comment out the next line, and just run "docker-compose build".
dockerfile: DockerfileStage2
# For the 2 stage build process run
# docker build --tag webwork-base:forWW218 -f DockerfileStage1 .
# docker build --tag webwork-base:forWW219 -f DockerfileStage1 .
# and then
# docker-compose build
# When rebuilding to get updated images add the "--no-cache" option to both commands.
Expand Down

0 comments on commit d2bb66e

Please sign in to comment.