Skip to content

Conversation

williamdes
Copy link
Contributor

Replaces #20042

@williamdes williamdes requested a review from a team as a code owner October 8, 2025 10:47

This comment has been minimized.

@ibennetch
Copy link
Contributor

ibennetch commented Oct 8, 2025

There's a small update pending to fix a leftover downloaded artifact during the build process, I'm sure @williamdes will update this pull request in a bit.

@tianon
Copy link
Member

tianon commented Oct 8, 2025

With the code extracting into /usr/src/php, I think the entire extracted PHP source is going to be left around too, thanks to https://github.com/docker-library/php/blob/a80c2f9204ed2e3ca0a13b13cc0cae780d9d700d/docker-php-ext-configure#L10-L17 😅

I'd suggest extracting this tarball elsewhere and passing a full path to the docker-php-ext-... script.
(Doing phpize, etc yourself or using pecl install are also sane options, but with varying downsides 😅)

This comment has been minimized.

@williamdes
Copy link
Contributor Author

williamdes commented Oct 8, 2025

With the code extracting into /usr/src/php, I think the entire extracted PHP source is going to be left around too, thanks to https://github.com/docker-library/php/blob/a80c2f9204ed2e3ca0a13b13cc0cae780d9d700d/docker-php-ext-configure#L10-L17 😅

I'd suggest extracting this tarball elsewhere and passing a full path to the docker-php-ext-... script. (Doing phpize, etc yourself or using pecl install are also sane options, but with varying downsides 😅)

For now we are at phpmyadmin/docker#466
Is it required to keep the source ?
The CIs are happy
And keeping the source may get some users to want the source removed ? Or other extensions still have their source ?
Let us know

@tianon
Copy link
Member

tianon commented Oct 8, 2025

Perhaps a small change will illustrate better; let's start with a baseline build from your latest master branch:

$ docker buildx build --pull --tag phpmyadmin:as-is apache
...
$ docker images phpmyadmin
REPOSITORY:TAG     IMAGE ID       CREATED          SIZE
phpmyadmin:as-is   9ca8129fdb84   2 minutes ago    742MB

Then we apply a minor change to move the uploadprogress extension source into /tmp/uploadprogress:

diff --git a/apache/Dockerfile b/apache/Dockerfile
index 0ed8edc..24cb10d 100644
--- a/apache/Dockerfile
+++ b/apache/Dockerfile
@@ -25,10 +25,10 @@ RUN set -ex; \
         libzip-dev \
     ; \
     \
-    mkdir -p /usr/src/php/ext/uploadprogress; \
-    curl -fsSL -o /usr/src/php/ext/uploadprogress.tar.gz "$UPLOAD_PROGRESS_EXT_URL"; \
-    echo "$UPLOAD_PROGRESS_SHA256 /usr/src/php/ext/uploadprogress.tar.gz" | sha256sum -c -; \
-    tar -xf /usr/src/php/ext/uploadprogress.tar.gz -C /usr/src/php/ext/uploadprogress --strip-components=1; \
+    mkdir -p /tmp/uploadprogress; \
+    curl -fsSL -o /tmp/uploadprogress/uploadprogress.tar.gz "$UPLOAD_PROGRESS_EXT_URL"; \
+    echo "$UPLOAD_PROGRESS_SHA256 */tmp/uploadprogress/uploadprogress.tar.gz" | sha256sum -c -; \
+    tar -xf /tmp/uploadprogress/uploadprogress.tar.gz -C /tmp/uploadprogress --strip-components=1; \
     \
     docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp --with-xpm; \
     docker-php-ext-install -j "$(nproc)" \
@@ -38,10 +38,10 @@ RUN set -ex; \
         opcache \
         zip \
         bcmath \
-        uploadprogress \
+        /tmp/uploadprogress \
     ; \
     \
-    rm -r /usr/src/php/ext/uploadprogress /usr/src/php/ext/uploadprogress.tar.gz; \
+    rm -r /tmp/uploadprogress; \
     \
     apt-mark auto '.*' > /dev/null; \
     apt-mark manual $savedAptMark; \

Then we build again, and we see a very dramatic image size decrease:

$ docker buildx build --pull --tag phpmyadmin:tmp apache
...
$ docker images phpmyadmin
REPOSITORY:TAG     IMAGE ID       CREATED          SIZE
phpmyadmin:tmp     5d8b870ea142   17 seconds ago   576MB
phpmyadmin:as-is   9ca8129fdb84   2 minutes ago    742MB

(and again, this is due to the lines/behavior I linked above)

Copy link

github-actions bot commented Oct 8, 2025

Diff for 902d668:
diff --git a/_bashbrew-cat b/_bashbrew-cat
index 985917f..a4909a5 100644
--- a/_bashbrew-cat
+++ b/_bashbrew-cat
@@ -1,17 +1,17 @@
 Maintainers: Isaac Bennetch <[email protected]> (@ibennetch), William Desportes <[email protected]> (@williamdes)
 GitRepo: https://github.com/phpmyadmin/docker.git
 
-Tags: 5.2.2-apache, 5.2-apache, 5-apache, apache, 5.2.2, 5.2, 5, latest
+Tags: 5.2.3-apache, 5.2-apache, 5-apache, apache, 5.2.3, 5.2, 5, latest
 Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x
-GitCommit: 24c2f1f855bfa93c9c2640261f601620bf312f17
+GitCommit: 452a995fe6c90b96473fc17c3d704786c33d42bc
 Directory: apache
 
-Tags: 5.2.2-fpm, 5.2-fpm, 5-fpm, fpm
+Tags: 5.2.3-fpm, 5.2-fpm, 5-fpm, fpm
 Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x
-GitCommit: 24c2f1f855bfa93c9c2640261f601620bf312f17
+GitCommit: 452a995fe6c90b96473fc17c3d704786c33d42bc
 Directory: fpm
 
-Tags: 5.2.2-fpm-alpine, 5.2-fpm-alpine, 5-fpm-alpine, fpm-alpine
+Tags: 5.2.3-fpm-alpine, 5.2-fpm-alpine, 5-fpm-alpine, fpm-alpine
 Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x
-GitCommit: 24c2f1f855bfa93c9c2640261f601620bf312f17
+GitCommit: 452a995fe6c90b96473fc17c3d704786c33d42bc
 Directory: fpm-alpine
diff --git a/_bashbrew-list b/_bashbrew-list
index bdebc12..c6f49b5 100644
--- a/_bashbrew-list
+++ b/_bashbrew-list
@@ -6,10 +6,10 @@ phpmyadmin:5.2
 phpmyadmin:5.2-apache
 phpmyadmin:5.2-fpm
 phpmyadmin:5.2-fpm-alpine
-phpmyadmin:5.2.2
-phpmyadmin:5.2.2-apache
-phpmyadmin:5.2.2-fpm
-phpmyadmin:5.2.2-fpm-alpine
+phpmyadmin:5.2.3
+phpmyadmin:5.2.3-apache
+phpmyadmin:5.2.3-fpm
+phpmyadmin:5.2.3-fpm-alpine
 phpmyadmin:apache
 phpmyadmin:fpm
 phpmyadmin:fpm-alpine
diff --git a/phpmyadmin_fpm-alpine/Dockerfile b/phpmyadmin_fpm-alpine/Dockerfile
index 07b3673..dcac4fc 100644
--- a/phpmyadmin_fpm-alpine/Dockerfile
+++ b/phpmyadmin_fpm-alpine/Dockerfile
@@ -1,5 +1,8 @@
 # DO NOT EDIT: created by update.sh from Dockerfile-alpine.template
-FROM php:8.2-fpm-alpine
+FROM php:8.3-fpm-alpine
+
+ENV UPLOAD_PROGRESS_EXT_URL="https://github.com/php/pecl-php-uploadprogress/archive/refs/tags/uploadprogress-2.0.2.tar.gz"
+ENV UPLOAD_PROGRESS_SHA256="fe3f6cdfcedad563c970c4fd1cda31e422cfc0df5cc9a217d8c80ed3c8d137f5"
 
 # install and docker-entrypoint.sh dependencies
 RUN apk add --no-cache \
@@ -20,6 +23,11 @@ RUN set -ex; \
         libzip-dev \
     ; \
     \
+    mkdir -p /tmp/uploadprogress; \
+    curl -fsSL -o /tmp/uploadprogress/uploadprogress.tar.gz "$UPLOAD_PROGRESS_EXT_URL"; \
+    echo "$UPLOAD_PROGRESS_SHA256 /tmp/uploadprogress/uploadprogress.tar.gz" | sha256sum -c -; \
+    tar -xf /tmp/uploadprogress/uploadprogress.tar.gz -C /tmp/uploadprogress --strip-components=1; \
+    \
     docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp --with-xpm; \
     docker-php-ext-install -j "$(nproc)" \
         bz2 \
@@ -28,8 +36,11 @@ RUN set -ex; \
         opcache \
         zip \
         bcmath \
+        /tmp/uploadprogress \
     ; \
     \
+    rm -r /tmp/uploadprogress; \
+    \
     runDeps="$( \
         scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \
             | tr ',' '\n' \
@@ -83,8 +94,8 @@ RUN set -ex; \
 USER www-data:www-data
 
 # Calculate download URL
-ENV VERSION=5.2.2
-ENV SHA256=f881819a3b11e653b0212afaf0cc105db85c767715cb3f5852670f7fc36c9669
+ENV VERSION=5.2.3
+ENV SHA256=57881348297c4412f86c410547cf76b4d8a236574dd2c6b7d6a2beebe7fc44e3
 ENV URL=https://files.phpmyadmin.net/phpMyAdmin/${VERSION}/phpMyAdmin-${VERSION}-all-languages.tar.xz
 
 LABEL org.opencontainers.image.title="Official phpMyAdmin Docker image" \
diff --git a/phpmyadmin_fpm/Dockerfile b/phpmyadmin_fpm/Dockerfile
index 8609056..4b6fc4b 100644
--- a/phpmyadmin_fpm/Dockerfile
+++ b/phpmyadmin_fpm/Dockerfile
@@ -1,5 +1,8 @@
 # DO NOT EDIT: created by update.sh from Dockerfile-debian.template
-FROM php:8.2-fpm
+FROM php:8.3-fpm
+
+ENV UPLOAD_PROGRESS_EXT_URL="https://github.com/php/pecl-php-uploadprogress/archive/refs/tags/uploadprogress-2.0.2.tar.gz"
+ENV UPLOAD_PROGRESS_SHA256="fe3f6cdfcedad563c970c4fd1cda31e422cfc0df5cc9a217d8c80ed3c8d137f5"
 
 # Install dependencies
 RUN set -ex; \
@@ -22,6 +25,11 @@ RUN set -ex; \
         libzip-dev \
     ; \
     \
+    mkdir -p /tmp/uploadprogress; \
+    curl -fsSL -o /tmp/uploadprogress/uploadprogress.tar.gz "$UPLOAD_PROGRESS_EXT_URL"; \
+    echo "$UPLOAD_PROGRESS_SHA256 /tmp/uploadprogress/uploadprogress.tar.gz" | sha256sum -c -; \
+    tar -xf /tmp/uploadprogress/uploadprogress.tar.gz -C /tmp/uploadprogress --strip-components=1; \
+    \
     docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp --with-xpm; \
     docker-php-ext-install -j "$(nproc)" \
         bz2 \
@@ -30,8 +38,11 @@ RUN set -ex; \
         opcache \
         zip \
         bcmath \
+        /tmp/uploadprogress \
     ; \
     \
+    rm -r /tmp/uploadprogress; \
+    \
     apt-mark auto '.*' > /dev/null; \
     apt-mark manual $savedAptMark; \
     extdir="$(php -r 'echo ini_get("extension_dir");')"; \
@@ -95,8 +106,8 @@ RUN set -ex; \
 USER www-data:www-data
 
 # Calculate download URL
-ENV VERSION=5.2.2
-ENV SHA256=f881819a3b11e653b0212afaf0cc105db85c767715cb3f5852670f7fc36c9669
+ENV VERSION=5.2.3
+ENV SHA256=57881348297c4412f86c410547cf76b4d8a236574dd2c6b7d6a2beebe7fc44e3
 ENV URL=https://files.phpmyadmin.net/phpMyAdmin/${VERSION}/phpMyAdmin-${VERSION}-all-languages.tar.xz
 
 LABEL org.opencontainers.image.title="Official phpMyAdmin Docker image" \
diff --git a/phpmyadmin_latest/Dockerfile b/phpmyadmin_latest/Dockerfile
index 8015275..eaf234e 100644
--- a/phpmyadmin_latest/Dockerfile
+++ b/phpmyadmin_latest/Dockerfile
@@ -1,5 +1,8 @@
 # DO NOT EDIT: created by update.sh from Dockerfile-debian.template
-FROM php:8.2-apache
+FROM php:8.3-apache
+
+ENV UPLOAD_PROGRESS_EXT_URL="https://github.com/php/pecl-php-uploadprogress/archive/refs/tags/uploadprogress-2.0.2.tar.gz"
+ENV UPLOAD_PROGRESS_SHA256="fe3f6cdfcedad563c970c4fd1cda31e422cfc0df5cc9a217d8c80ed3c8d137f5"
 
 # Install dependencies
 RUN set -ex; \
@@ -22,6 +25,11 @@ RUN set -ex; \
         libzip-dev \
     ; \
     \
+    mkdir -p /tmp/uploadprogress; \
+    curl -fsSL -o /tmp/uploadprogress/uploadprogress.tar.gz "$UPLOAD_PROGRESS_EXT_URL"; \
+    echo "$UPLOAD_PROGRESS_SHA256 /tmp/uploadprogress/uploadprogress.tar.gz" | sha256sum -c -; \
+    tar -xf /tmp/uploadprogress/uploadprogress.tar.gz -C /tmp/uploadprogress --strip-components=1; \
+    \
     docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp --with-xpm; \
     docker-php-ext-install -j "$(nproc)" \
         bz2 \
@@ -30,8 +38,11 @@ RUN set -ex; \
         opcache \
         zip \
         bcmath \
+        /tmp/uploadprogress \
     ; \
     \
+    rm -r /tmp/uploadprogress; \
+    \
     apt-mark auto '.*' > /dev/null; \
     apt-mark manual $savedAptMark; \
     extdir="$(php -r 'echo ini_get("extension_dir");')"; \
@@ -98,8 +109,8 @@ RUN set -ex; \
 USER www-data:www-data
 
 # Calculate download URL
-ENV VERSION=5.2.2
-ENV SHA256=f881819a3b11e653b0212afaf0cc105db85c767715cb3f5852670f7fc36c9669
+ENV VERSION=5.2.3
+ENV SHA256=57881348297c4412f86c410547cf76b4d8a236574dd2c6b7d6a2beebe7fc44e3
 ENV URL=https://files.phpmyadmin.net/phpMyAdmin/${VERSION}/phpMyAdmin-${VERSION}-all-languages.tar.xz
 
 LABEL org.opencontainers.image.title="Official phpMyAdmin Docker image" \

Relevant Maintainers:

@williamdes
Copy link
Contributor Author

Thank you for the precious advice !
I applied 99.9% of it, no need for the star * in the shasum

@tianon tianon merged commit 43fb1ae into docker-library:master Oct 8, 2025
8 checks passed
@williamdes williamdes deleted the update-phpmyadmin branch October 8, 2025 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants