From 7c8d5b9e64536fc178ce4d1036b2d3fb1ea46f0a Mon Sep 17 00:00:00 2001 From: Michael Vasseur Date: Sun, 28 Apr 2024 15:01:02 +0200 Subject: [PATCH] Upgrade gitlab image to 24.04 Also removed some unneeded packages as we don't run those tests anymore. We need some extra changes for the pa11y now as the chrome-browser gets installed in an unreachable location for the domjudge user. Also download the latest dictionary file now as we use the system codespell now. Composer is now again in the ubuntu repo's so we reverted to using that one. --- docker-gitlabci/Dockerfile | 44 ++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 25 deletions(-) diff --git a/docker-gitlabci/Dockerfile b/docker-gitlabci/Dockerfile index 81d43e70..58775246 100644 --- a/docker-gitlabci/Dockerfile +++ b/docker-gitlabci/Dockerfile @@ -1,44 +1,29 @@ -FROM ubuntu:22.04 +FROM ubuntu:24.04 ENV DEBIAN_FRONTEND=noninteractive -ENV PHPSUPPORTED="7.2 7.3 8.0 8.1 8.2" +ENV PHPSUPPORTED="7.4 8.0 8.2 8.3" ENV APTINSTALL="apt install -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold" RUN apt update && apt install -y \ acl make zip unzip apache2-utils bsdmainutils libcurl4-gnutls-dev \ libjsoncpp-dev libmagic-dev autoconf automake bats sudo debootstrap procps \ gcc g++ default-jre-headless default-jdk ghc fp-compiler libcgroup-dev \ - devscripts shellcheck nginx libboost-regex-dev \ - php8.1 php8.1-cli php8.1-gd php8.1-curl php8.1-mysql php8.1-gmp php8.1-zip php8.1-xml php8.1-mbstring php8.1-fpm php8.1-intl php8.1-pcov \ - # W3c test \ - httrack \ - # Visual regression browser \ - cutycapt xvfb openimageio-tools imagemagick \ + devscripts shellcheck nginx libboost-regex-dev composer codespell \ + php8.3 php8.3-cli php8.3-gd php8.3-curl php8.3-mysql php8.3-gmp php8.3-zip php8.3-xml php8.3-mbstring php8.3-fpm php8.3-intl php8.3-pcov \ # Submit client \ python3-requests python3-magic \ # Docs \ python3-sphinx python3-sphinx-rtd-theme rst2pdf fontconfig python3-yaml \ - texlive-latex-recommended texlive-latex-extra \ - texlive-fonts-recommended texlive-lang-european latexmk \ + texlive-latex-recommended texlive-latex-extra texlive-lang-european latexmk \ # Misc gitlab things \ mariadb-client curl build-essential packaging-dev \ git python3-pip moreutils w3m python3-yaml \ # Things we'd have in the chroot \ - ca-certificates default-jre-headless pypy locales software-properties-common \ + ca-certificates default-jre-headless pypy3 locales software-properties-common \ # W3c WCAG \ - npm libnss3 libcups2 libxss1 libasound2 libatk1.0-0 libatk-bridge2.0-0 libpangocairo-1.0-0 libgtk-3-0 \ - # Code coverage for unit test + npm \ + # Code coverage for unit test \ php-pear php-dev \ # Needed NPM packages \ - && npm install -g pa11y \ - # Needed python packages \ - && pip install codespell \ - && rm -rf /var/lib/apt/lists/* - -# Install composer -RUN apt update && \ - apt install --no-install-recommends --no-install-suggests -y ca-certificates \ - && rm -rf /var/lib/apt/lists/* \ - && php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && php composer-setup.php \ - && mv /composer.phar /usr/local/bin/composer + && npm install -g pa11y puppeteer # Install needed global PHP modules RUN composer -n require justinrainbow/json-schema @@ -51,7 +36,8 @@ RUN add-apt-repository ppa:ondrej/php -y && apt update && \ for PACKAGE in $PACKAGES; do \ $APTINSTALL php${VERSION}-${PACKAGE#php*-}; \ done; \ - done && update-alternatives --set php /usr/bin/php8.1 + done && update-alternatives --set php /usr/bin/php8.3 \ + && rm -rf /var/lib/apt/lists/* # Put the gitlab user in sudo RUN echo 'ALL ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers @@ -61,6 +47,14 @@ RUN useradd -d /nonexistent -g nogroup -s /bin/false domjudge-run-0 RUN useradd -d /nonexistent -g nogroup -s /bin/false domjudge-run-1 RUN groupadd domjudge-run +# Download chrome for the domjudge user +RUN su domjudge -c "npx puppeteer browsers install chrome" + +# Update dictionary to latest version +ENV GITHUBDICTIONARY="https://raw.githubusercontent.com/codespell-project/codespell/master/codespell_lib/data/dictionary.txt" +ENV CODESPELLDICTLOCATION="/usr/lib/python3/dist-packages/codespell_lib/data/dictionary.txt" +RUN wget $GITHUBDICTIONARY -O $CODESPELLDICTLOCATION + # Do some extra setup RUN mkdir -p /run/php \ && rm /etc/php/*/fpm/pool.d/www.conf