From d53c61bd040abe11e20eb2a74f364c233e61cefc Mon Sep 17 00:00:00 2001 From: Shish Date: Tue, 10 Jan 2023 19:03:30 +0000 Subject: [PATCH] fix breakages from debian unstable --- Dockerfile | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 97c67322..e2f9eaad 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,10 @@ +ARG PHP_VERSION=8.2 + # "Build" shimmie (composer install - done in its own stage so that we don't # need to include all the composer fluff in the final image) FROM debian:unstable AS app -RUN apt update && apt install -y composer php8.1-gd php8.1-dom php8.1-sqlite3 php-xdebug imagemagick +RUN apt update && apt upgrade -y +RUN apt install -y composer php${PHP_VERSION}-gd php${PHP_VERSION}-xml php${PHP_VERSION}-sqlite3 php${PHP_VERSION}-xdebug imagemagick COPY composer.json composer.lock /app/ WORKDIR /app RUN composer install --no-dev @@ -11,7 +14,8 @@ COPY . /app/ # `composer install` phpunit on top of that; but for some reason # `composer install --no-dev && composer install` doesn't install dev FROM debian:unstable AS tests -RUN apt update && apt install -y composer php8.1-gd php8.1-dom php8.1-sqlite3 php-xdebug imagemagick +RUN apt update && apt upgrade -y +RUN apt install -y composer php${PHP_VERSION}-gd php${PHP_VERSION}-xml php${PHP_VERSION}-sqlite3 php${PHP_VERSION}-xdebug imagemagick COPY composer.json composer.lock /app/ WORKDIR /app RUN composer install @@ -26,11 +30,12 @@ RUN [ $RUN_TESTS = false ] || (\ # Build su-exec so that our final image can be nicer FROM debian:unstable AS suexec -RUN apt-get update && apt-get install -y --no-install-recommends gcc libc-dev curl -RUN curl -k -o /usr/local/bin/su-exec.c https://raw.githubusercontent.com/ncopa/su-exec/master/su-exec.c; \ - gcc -Wall /usr/local/bin/su-exec.c -o/usr/local/bin/su-exec; \ - chown root:root /usr/local/bin/su-exec; \ - chmod 0755 /usr/local/bin/su-exec; +RUN apt update && apt upgrade -y +RUN apt install -y --no-install-recommends gcc libc-dev curl +RUN curl -k -o /usr/local/bin/su-exec.c https://raw.githubusercontent.com/ncopa/su-exec/master/su-exec.c; \ + gcc -Wall /usr/local/bin/su-exec.c -o/usr/local/bin/su-exec; \ + chown root:root /usr/local/bin/su-exec; \ + chmod 0755 /usr/local/bin/su-exec; # Actually run shimmie FROM debian:unstable @@ -38,9 +43,10 @@ EXPOSE 8000 HEALTHCHECK --interval=1m --timeout=3s CMD curl --fail http://127.0.0.1:8000/ || exit 1 ENV UID=1000 \ GID=1000 -RUN apt update && apt install -y curl \ - php8.1-cli php8.1-gd php8.1-pgsql php8.1-mysql php8.1-sqlite3 php8.1-zip php8.1-dom php8.1-mbstring \ - imagemagick zip unzip && \ +RUN apt update && apt upgrade -y && apt install -y \ + php${PHP_VERSION}-cli php${PHP_VERSION}-gd php${PHP_VERSION}-zip php${PHP_VERSION}-xml php${PHP_VERSION}-mbstring \ + php${PHP_VERSION}-pgsql php${PHP_VERSION}-mysql php${PHP_VERSION}-sqlite3 \ + curl imagemagick zip unzip && \ rm -rf /var/lib/apt/lists/* COPY --from=app /app /app COPY --from=suexec /usr/local/bin/su-exec /usr/local/bin/su-exec