From 83e8b18c6c6893f5beff6b2d81739791623980d8 Mon Sep 17 00:00:00 2001 From: Marji Cermak Date: Thu, 15 Aug 2024 15:11:24 +1000 Subject: [PATCH 1/5] composer 2.7.1 (recommended by Drupal core 10.2.7). --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 69fe0c0..70151f0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,8 +5,8 @@ ARG RUNNER_UID=1001 LABEL maintainer="marji@morpht.com" LABEL org.opencontainers.image.source="https://github.com/morpht/ci-php" -ENV COMPOSER_VERSION=2.6.6 \ - COMPOSER_HASH_SHA256=72600201c73c7c4b218f1c0511b36d8537963e36aafa244757f52309f885b314 +ENV COMPOSER_VERSION=2.7.1 \ + COMPOSER_HASH_SHA256=1ffd0be3f27e237b1ae47f9e8f29f96ac7f50a0bd9eef4f88cdbe94dd04bfff0 RUN apk add --no-cache --update git \ bash \ From b3e79d472a0b6dd6bd5a5b6482ab792b98f0dd4f Mon Sep 17 00:00:00 2001 From: Marji Cermak Date: Thu, 15 Aug 2024 15:21:53 +1000 Subject: [PATCH 2/5] Bump PHP to 8.2.22 and Alpine to 3.19 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index a9636f3..0387133 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.2.14-alpine3.18 +FROM php:8.2.22-alpine3.19 ARG RUNNER_UID=1001 From 6f5346078f9904fa859e3481fd28ef5f61638e87 Mon Sep 17 00:00:00 2001 From: Naveen Valecha Date: Sun, 18 Aug 2024 23:06:24 +1000 Subject: [PATCH 3/5] PHP 8.2 COMPOSER_ALLOW_SUPERUSER temp fix. --- Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Dockerfile b/Dockerfile index 0387133..e1c21a2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,6 +8,10 @@ LABEL org.opencontainers.image.source="https://github.com/morpht/ci-php" ENV COMPOSER_VERSION=2.7.1 \ COMPOSER_HASH_SHA256=1ffd0be3f27e237b1ae47f9e8f29f96ac7f50a0bd9eef4f88cdbe94dd04bfff0 +# Allow composer to run plugins during build. +# https://github.com/composer/composer/issues/11839 +ENV COMPOSER_ALLOW_SUPERUSER=1 + RUN apk add --no-cache --update git \ bash \ openssh-client \ From 66bd09d8beb7929b6a934793e8e73dd4ee2b70c9 Mon Sep 17 00:00:00 2001 From: Marji Cermak Date: Mon, 19 Aug 2024 12:31:31 +1000 Subject: [PATCH 4/5] We cannot use unprivileged user. --- Dockerfile | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index e1c21a2..9812f3c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM php:8.2.22-alpine3.19 -ARG RUNNER_UID=1001 +# ARG RUNNER_UID=1001 LABEL maintainer="marji@morpht.com" LABEL org.opencontainers.image.source="https://github.com/morpht/ci-php" @@ -8,10 +8,6 @@ LABEL org.opencontainers.image.source="https://github.com/morpht/ci-php" ENV COMPOSER_VERSION=2.7.1 \ COMPOSER_HASH_SHA256=1ffd0be3f27e237b1ae47f9e8f29f96ac7f50a0bd9eef4f88cdbe94dd04bfff0 -# Allow composer to run plugins during build. -# https://github.com/composer/composer/issues/11839 -ENV COMPOSER_ALLOW_SUPERUSER=1 - RUN apk add --no-cache --update git \ bash \ openssh-client \ @@ -27,6 +23,6 @@ RUN apk add --no-cache --update git \ && chmod +x /usr/local/bin/composer \ && echo 'memory_limit = ${PHP_MEMORY_LIMIT}' > /usr/local/etc/php/conf.d/memory-limit.ini -RUN adduser -D -h /home/runner -u $RUNNER_UID runner +# RUN adduser -D -h /home/runner -u $RUNNER_UID runner -USER runner +# USER runner From 6d71b33a55f4de5ccefddf06a80252756c8ee48d Mon Sep 17 00:00:00 2001 From: Marji Cermak Date: Mon, 19 Aug 2024 13:01:30 +1000 Subject: [PATCH 5/5] Do not set PHP memory_limit. --- Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9812f3c..074e738 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,8 +20,7 @@ RUN apk add --no-cache --update git \ && rm -rf /var/cache/apk/* \ && curl -L -o /usr/local/bin/composer https://github.com/composer/composer/releases/download/${COMPOSER_VERSION}/composer.phar \ && echo "$COMPOSER_HASH_SHA256 /usr/local/bin/composer" | sha256sum -c \ - && chmod +x /usr/local/bin/composer \ - && echo 'memory_limit = ${PHP_MEMORY_LIMIT}' > /usr/local/etc/php/conf.d/memory-limit.ini + && chmod +x /usr/local/bin/composer # RUN adduser -D -h /home/runner -u $RUNNER_UID runner