From 968fda81e15815a36dec41984e102df1204d42d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1chym=20Tou=C5=A1ek?= Date: Mon, 4 Apr 2022 16:15:16 +0200 Subject: [PATCH 1/3] Add ARG DEBUG --- Dockerfile-linux.template | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Dockerfile-linux.template b/Dockerfile-linux.template index 75a6d2d8fc..0960dd244b 100644 --- a/Dockerfile-linux.template +++ b/Dockerfile-linux.template @@ -15,6 +15,9 @@ -}} FROM {{ env.from }} +# Enables debug image when built with: --build-arg DEBUG=1 +ARG DEBUG + {{ if is_alpine then "" else ( -}} # prevent Debian's PHP packages from being installed # https://github.com/docker-library/php/pull/542 @@ -385,11 +388,12 @@ RUN set -eux; \ --enable-maintainer-zts \ {{ ) end -}} {{ ) else "" end -}} + ${DEBUG:+--enable-debug} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - find \ + if [ -z "$DEBUG" ] ; find \ /usr/local \ -type f \ -perm '/0111' \ @@ -397,6 +401,7 @@ RUN set -eux; \ strip --strip-all "$@" || : \ ' -- '{}' + \ ; \ + fi ; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) From 202baaea7ead3db3f82bade714f1477ac679ba5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1chym=20Tou=C5=A1ek?= Date: Tue, 5 Apr 2022 10:31:25 +0200 Subject: [PATCH 2/3] Revert strip-all condition --- Dockerfile-linux.template | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile-linux.template b/Dockerfile-linux.template index 0960dd244b..6dc551a6db 100644 --- a/Dockerfile-linux.template +++ b/Dockerfile-linux.template @@ -393,7 +393,7 @@ RUN set -eux; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - if [ -z "$DEBUG" ] ; find \ + find \ /usr/local \ -type f \ -perm '/0111' \ @@ -401,7 +401,6 @@ RUN set -eux; \ strip --strip-all "$@" || : \ ' -- '{}' + \ ; \ - fi ; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) From 38fad45199637b0f0d73eed5589e89f0cc3a6283 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1chym=20Tou=C5=A1ek?= Date: Tue, 5 Apr 2022 10:40:42 +0200 Subject: [PATCH 3/3] apply templates --- 7.4/alpine3.14/cli/Dockerfile | 4 ++++ 7.4/alpine3.14/fpm/Dockerfile | 4 ++++ 7.4/alpine3.14/zts/Dockerfile | 4 ++++ 7.4/alpine3.15/cli/Dockerfile | 4 ++++ 7.4/alpine3.15/fpm/Dockerfile | 4 ++++ 7.4/alpine3.15/zts/Dockerfile | 4 ++++ 7.4/bullseye/apache/Dockerfile | 4 ++++ 7.4/bullseye/cli/Dockerfile | 4 ++++ 7.4/bullseye/fpm/Dockerfile | 4 ++++ 7.4/bullseye/zts/Dockerfile | 4 ++++ 7.4/buster/apache/Dockerfile | 4 ++++ 7.4/buster/cli/Dockerfile | 4 ++++ 7.4/buster/fpm/Dockerfile | 4 ++++ 7.4/buster/zts/Dockerfile | 4 ++++ 8.0/alpine3.14/cli/Dockerfile | 4 ++++ 8.0/alpine3.14/fpm/Dockerfile | 4 ++++ 8.0/alpine3.15/cli/Dockerfile | 4 ++++ 8.0/alpine3.15/fpm/Dockerfile | 4 ++++ 8.0/bullseye/apache/Dockerfile | 4 ++++ 8.0/bullseye/cli/Dockerfile | 4 ++++ 8.0/bullseye/fpm/Dockerfile | 4 ++++ 8.0/bullseye/zts/Dockerfile | 4 ++++ 8.0/buster/apache/Dockerfile | 4 ++++ 8.0/buster/cli/Dockerfile | 4 ++++ 8.0/buster/fpm/Dockerfile | 4 ++++ 8.0/buster/zts/Dockerfile | 4 ++++ 8.1-rc/alpine3.14/cli/Dockerfile | 4 ++++ 8.1-rc/alpine3.14/fpm/Dockerfile | 4 ++++ 8.1-rc/alpine3.15/cli/Dockerfile | 4 ++++ 8.1-rc/alpine3.15/fpm/Dockerfile | 4 ++++ 8.1-rc/bullseye/apache/Dockerfile | 4 ++++ 8.1-rc/bullseye/cli/Dockerfile | 4 ++++ 8.1-rc/bullseye/fpm/Dockerfile | 4 ++++ 8.1-rc/bullseye/zts/Dockerfile | 4 ++++ 8.1-rc/buster/apache/Dockerfile | 4 ++++ 8.1-rc/buster/cli/Dockerfile | 4 ++++ 8.1-rc/buster/fpm/Dockerfile | 4 ++++ 8.1-rc/buster/zts/Dockerfile | 4 ++++ 8.1/alpine3.14/cli/Dockerfile | 4 ++++ 8.1/alpine3.14/fpm/Dockerfile | 4 ++++ 8.1/alpine3.15/cli/Dockerfile | 4 ++++ 8.1/alpine3.15/fpm/Dockerfile | 4 ++++ 8.1/bullseye/apache/Dockerfile | 4 ++++ 8.1/bullseye/cli/Dockerfile | 4 ++++ 8.1/bullseye/fpm/Dockerfile | 4 ++++ 8.1/bullseye/zts/Dockerfile | 4 ++++ 8.1/buster/apache/Dockerfile | 4 ++++ 8.1/buster/cli/Dockerfile | 4 ++++ 8.1/buster/fpm/Dockerfile | 4 ++++ 8.1/buster/zts/Dockerfile | 4 ++++ 50 files changed, 200 insertions(+) diff --git a/7.4/alpine3.14/cli/Dockerfile b/7.4/alpine3.14/cli/Dockerfile index 713d6b76a9..cb01bdb0ab 100644 --- a/7.4/alpine3.14/cli/Dockerfile +++ b/7.4/alpine3.14/cli/Dockerfile @@ -6,6 +6,9 @@ FROM alpine:3.14 +# Enables debug image when built with: --build-arg DEBUG=1 +ARG DEBUG + # dependencies required for running "phpize" # these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) ENV PHPIZE_DEPS \ @@ -162,6 +165,7 @@ RUN set -eux; \ # bundled pcre does not support JIT on s390x # https://manpages.debian.org/bullseye/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT $(test "$gnuArch" = 's390x-linux-musl' && echo '--without-pcre-jit') \ + ${DEBUG:+--enable-debug} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ diff --git a/7.4/alpine3.14/fpm/Dockerfile b/7.4/alpine3.14/fpm/Dockerfile index 4089e92d05..3c5b9389a1 100644 --- a/7.4/alpine3.14/fpm/Dockerfile +++ b/7.4/alpine3.14/fpm/Dockerfile @@ -6,6 +6,9 @@ FROM alpine:3.14 +# Enables debug image when built with: --build-arg DEBUG=1 +ARG DEBUG + # dependencies required for running "phpize" # these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) ENV PHPIZE_DEPS \ @@ -167,6 +170,7 @@ RUN set -eux; \ --enable-fpm \ --with-fpm-user=www-data \ --with-fpm-group=www-data \ + ${DEBUG:+--enable-debug} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ diff --git a/7.4/alpine3.14/zts/Dockerfile b/7.4/alpine3.14/zts/Dockerfile index 3aed583d87..754bc758e9 100644 --- a/7.4/alpine3.14/zts/Dockerfile +++ b/7.4/alpine3.14/zts/Dockerfile @@ -6,6 +6,9 @@ FROM alpine:3.14 +# Enables debug image when built with: --build-arg DEBUG=1 +ARG DEBUG + # dependencies required for running "phpize" # these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) ENV PHPIZE_DEPS \ @@ -165,6 +168,7 @@ RUN set -eux; \ --disable-cgi \ \ --enable-maintainer-zts \ + ${DEBUG:+--enable-debug} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ diff --git a/7.4/alpine3.15/cli/Dockerfile b/7.4/alpine3.15/cli/Dockerfile index ecf98da83d..631201527c 100644 --- a/7.4/alpine3.15/cli/Dockerfile +++ b/7.4/alpine3.15/cli/Dockerfile @@ -6,6 +6,9 @@ FROM alpine:3.15 +# Enables debug image when built with: --build-arg DEBUG=1 +ARG DEBUG + # dependencies required for running "phpize" # these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) ENV PHPIZE_DEPS \ @@ -162,6 +165,7 @@ RUN set -eux; \ # bundled pcre does not support JIT on s390x # https://manpages.debian.org/bullseye/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT $(test "$gnuArch" = 's390x-linux-musl' && echo '--without-pcre-jit') \ + ${DEBUG:+--enable-debug} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ diff --git a/7.4/alpine3.15/fpm/Dockerfile b/7.4/alpine3.15/fpm/Dockerfile index 5768aac977..8771744bb4 100644 --- a/7.4/alpine3.15/fpm/Dockerfile +++ b/7.4/alpine3.15/fpm/Dockerfile @@ -6,6 +6,9 @@ FROM alpine:3.15 +# Enables debug image when built with: --build-arg DEBUG=1 +ARG DEBUG + # dependencies required for running "phpize" # these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) ENV PHPIZE_DEPS \ @@ -167,6 +170,7 @@ RUN set -eux; \ --enable-fpm \ --with-fpm-user=www-data \ --with-fpm-group=www-data \ + ${DEBUG:+--enable-debug} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ diff --git a/7.4/alpine3.15/zts/Dockerfile b/7.4/alpine3.15/zts/Dockerfile index 3598e419f0..35bcd5bfb5 100644 --- a/7.4/alpine3.15/zts/Dockerfile +++ b/7.4/alpine3.15/zts/Dockerfile @@ -6,6 +6,9 @@ FROM alpine:3.15 +# Enables debug image when built with: --build-arg DEBUG=1 +ARG DEBUG + # dependencies required for running "phpize" # these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) ENV PHPIZE_DEPS \ @@ -165,6 +168,7 @@ RUN set -eux; \ --disable-cgi \ \ --enable-maintainer-zts \ + ${DEBUG:+--enable-debug} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ diff --git a/7.4/bullseye/apache/Dockerfile b/7.4/bullseye/apache/Dockerfile index deeefcf32e..d224b00635 100644 --- a/7.4/bullseye/apache/Dockerfile +++ b/7.4/bullseye/apache/Dockerfile @@ -6,6 +6,9 @@ FROM debian:bullseye-slim +# Enables debug image when built with: --build-arg DEBUG=1 +ARG DEBUG + # prevent Debian's PHP packages from being installed # https://github.com/docker-library/php/pull/542 RUN set -eux; \ @@ -233,6 +236,7 @@ RUN set -eux; \ --disable-cgi \ \ --with-apxs2 \ + ${DEBUG:+--enable-debug} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ diff --git a/7.4/bullseye/cli/Dockerfile b/7.4/bullseye/cli/Dockerfile index 6f7ec5db4b..cf7b18ed3b 100644 --- a/7.4/bullseye/cli/Dockerfile +++ b/7.4/bullseye/cli/Dockerfile @@ -6,6 +6,9 @@ FROM debian:bullseye-slim +# Enables debug image when built with: --build-arg DEBUG=1 +ARG DEBUG + # prevent Debian's PHP packages from being installed # https://github.com/docker-library/php/pull/542 RUN set -eux; \ @@ -174,6 +177,7 @@ RUN set -eux; \ \ # https://github.com/docker-library/php/pull/939#issuecomment-730501748 --enable-embed \ + ${DEBUG:+--enable-debug} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ diff --git a/7.4/bullseye/fpm/Dockerfile b/7.4/bullseye/fpm/Dockerfile index 68f05e443d..6f2e2933db 100644 --- a/7.4/bullseye/fpm/Dockerfile +++ b/7.4/bullseye/fpm/Dockerfile @@ -6,6 +6,9 @@ FROM debian:bullseye-slim +# Enables debug image when built with: --build-arg DEBUG=1 +ARG DEBUG + # prevent Debian's PHP packages from being installed # https://github.com/docker-library/php/pull/542 RUN set -eux; \ @@ -176,6 +179,7 @@ RUN set -eux; \ --enable-fpm \ --with-fpm-user=www-data \ --with-fpm-group=www-data \ + ${DEBUG:+--enable-debug} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ diff --git a/7.4/bullseye/zts/Dockerfile b/7.4/bullseye/zts/Dockerfile index c4230aae83..d19652ac10 100644 --- a/7.4/bullseye/zts/Dockerfile +++ b/7.4/bullseye/zts/Dockerfile @@ -6,6 +6,9 @@ FROM debian:bullseye-slim +# Enables debug image when built with: --build-arg DEBUG=1 +ARG DEBUG + # prevent Debian's PHP packages from being installed # https://github.com/docker-library/php/pull/542 RUN set -eux; \ @@ -177,6 +180,7 @@ RUN set -eux; \ --enable-embed \ \ --enable-maintainer-zts \ + ${DEBUG:+--enable-debug} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ diff --git a/7.4/buster/apache/Dockerfile b/7.4/buster/apache/Dockerfile index 726cf0968d..f11aa0889d 100644 --- a/7.4/buster/apache/Dockerfile +++ b/7.4/buster/apache/Dockerfile @@ -6,6 +6,9 @@ FROM debian:buster-slim +# Enables debug image when built with: --build-arg DEBUG=1 +ARG DEBUG + # prevent Debian's PHP packages from being installed # https://github.com/docker-library/php/pull/542 RUN set -eux; \ @@ -233,6 +236,7 @@ RUN set -eux; \ --disable-cgi \ \ --with-apxs2 \ + ${DEBUG:+--enable-debug} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ diff --git a/7.4/buster/cli/Dockerfile b/7.4/buster/cli/Dockerfile index 811f21a415..608d2727e1 100644 --- a/7.4/buster/cli/Dockerfile +++ b/7.4/buster/cli/Dockerfile @@ -6,6 +6,9 @@ FROM debian:buster-slim +# Enables debug image when built with: --build-arg DEBUG=1 +ARG DEBUG + # prevent Debian's PHP packages from being installed # https://github.com/docker-library/php/pull/542 RUN set -eux; \ @@ -174,6 +177,7 @@ RUN set -eux; \ \ # https://github.com/docker-library/php/pull/939#issuecomment-730501748 --enable-embed \ + ${DEBUG:+--enable-debug} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ diff --git a/7.4/buster/fpm/Dockerfile b/7.4/buster/fpm/Dockerfile index dfbb537f59..8dac888230 100644 --- a/7.4/buster/fpm/Dockerfile +++ b/7.4/buster/fpm/Dockerfile @@ -6,6 +6,9 @@ FROM debian:buster-slim +# Enables debug image when built with: --build-arg DEBUG=1 +ARG DEBUG + # prevent Debian's PHP packages from being installed # https://github.com/docker-library/php/pull/542 RUN set -eux; \ @@ -176,6 +179,7 @@ RUN set -eux; \ --enable-fpm \ --with-fpm-user=www-data \ --with-fpm-group=www-data \ + ${DEBUG:+--enable-debug} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ diff --git a/7.4/buster/zts/Dockerfile b/7.4/buster/zts/Dockerfile index ff3eb3184d..191b269167 100644 --- a/7.4/buster/zts/Dockerfile +++ b/7.4/buster/zts/Dockerfile @@ -6,6 +6,9 @@ FROM debian:buster-slim +# Enables debug image when built with: --build-arg DEBUG=1 +ARG DEBUG + # prevent Debian's PHP packages from being installed # https://github.com/docker-library/php/pull/542 RUN set -eux; \ @@ -177,6 +180,7 @@ RUN set -eux; \ --enable-embed \ \ --enable-maintainer-zts \ + ${DEBUG:+--enable-debug} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ diff --git a/8.0/alpine3.14/cli/Dockerfile b/8.0/alpine3.14/cli/Dockerfile index 1bbe7774e5..c764b936d1 100644 --- a/8.0/alpine3.14/cli/Dockerfile +++ b/8.0/alpine3.14/cli/Dockerfile @@ -6,6 +6,9 @@ FROM alpine:3.14 +# Enables debug image when built with: --build-arg DEBUG=1 +ARG DEBUG + # dependencies required for running "phpize" # these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) ENV PHPIZE_DEPS \ @@ -160,6 +163,7 @@ RUN set -eux; \ # bundled pcre does not support JIT on s390x # https://manpages.debian.org/bullseye/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT $(test "$gnuArch" = 's390x-linux-musl' && echo '--without-pcre-jit') \ + ${DEBUG:+--enable-debug} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ diff --git a/8.0/alpine3.14/fpm/Dockerfile b/8.0/alpine3.14/fpm/Dockerfile index 75fcee0041..ee04ec35d5 100644 --- a/8.0/alpine3.14/fpm/Dockerfile +++ b/8.0/alpine3.14/fpm/Dockerfile @@ -6,6 +6,9 @@ FROM alpine:3.14 +# Enables debug image when built with: --build-arg DEBUG=1 +ARG DEBUG + # dependencies required for running "phpize" # these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) ENV PHPIZE_DEPS \ @@ -165,6 +168,7 @@ RUN set -eux; \ --enable-fpm \ --with-fpm-user=www-data \ --with-fpm-group=www-data \ + ${DEBUG:+--enable-debug} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ diff --git a/8.0/alpine3.15/cli/Dockerfile b/8.0/alpine3.15/cli/Dockerfile index 60ba5cafaf..9a54b8cf33 100644 --- a/8.0/alpine3.15/cli/Dockerfile +++ b/8.0/alpine3.15/cli/Dockerfile @@ -6,6 +6,9 @@ FROM alpine:3.15 +# Enables debug image when built with: --build-arg DEBUG=1 +ARG DEBUG + # dependencies required for running "phpize" # these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) ENV PHPIZE_DEPS \ @@ -160,6 +163,7 @@ RUN set -eux; \ # bundled pcre does not support JIT on s390x # https://manpages.debian.org/bullseye/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT $(test "$gnuArch" = 's390x-linux-musl' && echo '--without-pcre-jit') \ + ${DEBUG:+--enable-debug} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ diff --git a/8.0/alpine3.15/fpm/Dockerfile b/8.0/alpine3.15/fpm/Dockerfile index 906e40b81e..94bec64cbb 100644 --- a/8.0/alpine3.15/fpm/Dockerfile +++ b/8.0/alpine3.15/fpm/Dockerfile @@ -6,6 +6,9 @@ FROM alpine:3.15 +# Enables debug image when built with: --build-arg DEBUG=1 +ARG DEBUG + # dependencies required for running "phpize" # these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) ENV PHPIZE_DEPS \ @@ -165,6 +168,7 @@ RUN set -eux; \ --enable-fpm \ --with-fpm-user=www-data \ --with-fpm-group=www-data \ + ${DEBUG:+--enable-debug} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ diff --git a/8.0/bullseye/apache/Dockerfile b/8.0/bullseye/apache/Dockerfile index db8ae00153..3037f86808 100644 --- a/8.0/bullseye/apache/Dockerfile +++ b/8.0/bullseye/apache/Dockerfile @@ -6,6 +6,9 @@ FROM debian:bullseye-slim +# Enables debug image when built with: --build-arg DEBUG=1 +ARG DEBUG + # prevent Debian's PHP packages from being installed # https://github.com/docker-library/php/pull/542 RUN set -eux; \ @@ -233,6 +236,7 @@ RUN set -eux; \ --disable-cgi \ \ --with-apxs2 \ + ${DEBUG:+--enable-debug} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ diff --git a/8.0/bullseye/cli/Dockerfile b/8.0/bullseye/cli/Dockerfile index 3d1d799370..32d675f6e5 100644 --- a/8.0/bullseye/cli/Dockerfile +++ b/8.0/bullseye/cli/Dockerfile @@ -6,6 +6,9 @@ FROM debian:bullseye-slim +# Enables debug image when built with: --build-arg DEBUG=1 +ARG DEBUG + # prevent Debian's PHP packages from being installed # https://github.com/docker-library/php/pull/542 RUN set -eux; \ @@ -174,6 +177,7 @@ RUN set -eux; \ \ # https://github.com/docker-library/php/pull/939#issuecomment-730501748 --enable-embed \ + ${DEBUG:+--enable-debug} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ diff --git a/8.0/bullseye/fpm/Dockerfile b/8.0/bullseye/fpm/Dockerfile index 69dd88f68c..8564760851 100644 --- a/8.0/bullseye/fpm/Dockerfile +++ b/8.0/bullseye/fpm/Dockerfile @@ -6,6 +6,9 @@ FROM debian:bullseye-slim +# Enables debug image when built with: --build-arg DEBUG=1 +ARG DEBUG + # prevent Debian's PHP packages from being installed # https://github.com/docker-library/php/pull/542 RUN set -eux; \ @@ -176,6 +179,7 @@ RUN set -eux; \ --enable-fpm \ --with-fpm-user=www-data \ --with-fpm-group=www-data \ + ${DEBUG:+--enable-debug} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ diff --git a/8.0/bullseye/zts/Dockerfile b/8.0/bullseye/zts/Dockerfile index c185311cb2..67a708445e 100644 --- a/8.0/bullseye/zts/Dockerfile +++ b/8.0/bullseye/zts/Dockerfile @@ -6,6 +6,9 @@ FROM debian:bullseye-slim +# Enables debug image when built with: --build-arg DEBUG=1 +ARG DEBUG + # prevent Debian's PHP packages from being installed # https://github.com/docker-library/php/pull/542 RUN set -eux; \ @@ -177,6 +180,7 @@ RUN set -eux; \ --enable-embed \ \ --enable-zts \ + ${DEBUG:+--enable-debug} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ diff --git a/8.0/buster/apache/Dockerfile b/8.0/buster/apache/Dockerfile index 9d26fa910b..3cafff11dc 100644 --- a/8.0/buster/apache/Dockerfile +++ b/8.0/buster/apache/Dockerfile @@ -6,6 +6,9 @@ FROM debian:buster-slim +# Enables debug image when built with: --build-arg DEBUG=1 +ARG DEBUG + # prevent Debian's PHP packages from being installed # https://github.com/docker-library/php/pull/542 RUN set -eux; \ @@ -233,6 +236,7 @@ RUN set -eux; \ --disable-cgi \ \ --with-apxs2 \ + ${DEBUG:+--enable-debug} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ diff --git a/8.0/buster/cli/Dockerfile b/8.0/buster/cli/Dockerfile index 718f1013ea..c136bce9be 100644 --- a/8.0/buster/cli/Dockerfile +++ b/8.0/buster/cli/Dockerfile @@ -6,6 +6,9 @@ FROM debian:buster-slim +# Enables debug image when built with: --build-arg DEBUG=1 +ARG DEBUG + # prevent Debian's PHP packages from being installed # https://github.com/docker-library/php/pull/542 RUN set -eux; \ @@ -174,6 +177,7 @@ RUN set -eux; \ \ # https://github.com/docker-library/php/pull/939#issuecomment-730501748 --enable-embed \ + ${DEBUG:+--enable-debug} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ diff --git a/8.0/buster/fpm/Dockerfile b/8.0/buster/fpm/Dockerfile index 2a84558eb0..b2862b3843 100644 --- a/8.0/buster/fpm/Dockerfile +++ b/8.0/buster/fpm/Dockerfile @@ -6,6 +6,9 @@ FROM debian:buster-slim +# Enables debug image when built with: --build-arg DEBUG=1 +ARG DEBUG + # prevent Debian's PHP packages from being installed # https://github.com/docker-library/php/pull/542 RUN set -eux; \ @@ -176,6 +179,7 @@ RUN set -eux; \ --enable-fpm \ --with-fpm-user=www-data \ --with-fpm-group=www-data \ + ${DEBUG:+--enable-debug} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ diff --git a/8.0/buster/zts/Dockerfile b/8.0/buster/zts/Dockerfile index 4d9c224bb0..18f476c352 100644 --- a/8.0/buster/zts/Dockerfile +++ b/8.0/buster/zts/Dockerfile @@ -6,6 +6,9 @@ FROM debian:buster-slim +# Enables debug image when built with: --build-arg DEBUG=1 +ARG DEBUG + # prevent Debian's PHP packages from being installed # https://github.com/docker-library/php/pull/542 RUN set -eux; \ @@ -177,6 +180,7 @@ RUN set -eux; \ --enable-embed \ \ --enable-zts \ + ${DEBUG:+--enable-debug} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ diff --git a/8.1-rc/alpine3.14/cli/Dockerfile b/8.1-rc/alpine3.14/cli/Dockerfile index e4b03c7f77..4bcaf028c7 100644 --- a/8.1-rc/alpine3.14/cli/Dockerfile +++ b/8.1-rc/alpine3.14/cli/Dockerfile @@ -6,6 +6,9 @@ FROM alpine:3.14 +# Enables debug image when built with: --build-arg DEBUG=1 +ARG DEBUG + # dependencies required for running "phpize" # these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) ENV PHPIZE_DEPS \ @@ -160,6 +163,7 @@ RUN set -eux; \ # bundled pcre does not support JIT on s390x # https://manpages.debian.org/bullseye/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT $(test "$gnuArch" = 's390x-linux-musl' && echo '--without-pcre-jit') \ + ${DEBUG:+--enable-debug} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ diff --git a/8.1-rc/alpine3.14/fpm/Dockerfile b/8.1-rc/alpine3.14/fpm/Dockerfile index f6c2be9bf7..dfaaf48589 100644 --- a/8.1-rc/alpine3.14/fpm/Dockerfile +++ b/8.1-rc/alpine3.14/fpm/Dockerfile @@ -6,6 +6,9 @@ FROM alpine:3.14 +# Enables debug image when built with: --build-arg DEBUG=1 +ARG DEBUG + # dependencies required for running "phpize" # these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) ENV PHPIZE_DEPS \ @@ -165,6 +168,7 @@ RUN set -eux; \ --enable-fpm \ --with-fpm-user=www-data \ --with-fpm-group=www-data \ + ${DEBUG:+--enable-debug} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ diff --git a/8.1-rc/alpine3.15/cli/Dockerfile b/8.1-rc/alpine3.15/cli/Dockerfile index f3dd595ae8..f74a8d4226 100644 --- a/8.1-rc/alpine3.15/cli/Dockerfile +++ b/8.1-rc/alpine3.15/cli/Dockerfile @@ -6,6 +6,9 @@ FROM alpine:3.15 +# Enables debug image when built with: --build-arg DEBUG=1 +ARG DEBUG + # dependencies required for running "phpize" # these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) ENV PHPIZE_DEPS \ @@ -160,6 +163,7 @@ RUN set -eux; \ # bundled pcre does not support JIT on s390x # https://manpages.debian.org/bullseye/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT $(test "$gnuArch" = 's390x-linux-musl' && echo '--without-pcre-jit') \ + ${DEBUG:+--enable-debug} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ diff --git a/8.1-rc/alpine3.15/fpm/Dockerfile b/8.1-rc/alpine3.15/fpm/Dockerfile index 0178265ddf..f66c169c79 100644 --- a/8.1-rc/alpine3.15/fpm/Dockerfile +++ b/8.1-rc/alpine3.15/fpm/Dockerfile @@ -6,6 +6,9 @@ FROM alpine:3.15 +# Enables debug image when built with: --build-arg DEBUG=1 +ARG DEBUG + # dependencies required for running "phpize" # these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) ENV PHPIZE_DEPS \ @@ -165,6 +168,7 @@ RUN set -eux; \ --enable-fpm \ --with-fpm-user=www-data \ --with-fpm-group=www-data \ + ${DEBUG:+--enable-debug} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ diff --git a/8.1-rc/bullseye/apache/Dockerfile b/8.1-rc/bullseye/apache/Dockerfile index 61d7656095..8dad531dbe 100644 --- a/8.1-rc/bullseye/apache/Dockerfile +++ b/8.1-rc/bullseye/apache/Dockerfile @@ -6,6 +6,9 @@ FROM debian:bullseye-slim +# Enables debug image when built with: --build-arg DEBUG=1 +ARG DEBUG + # prevent Debian's PHP packages from being installed # https://github.com/docker-library/php/pull/542 RUN set -eux; \ @@ -233,6 +236,7 @@ RUN set -eux; \ --disable-cgi \ \ --with-apxs2 \ + ${DEBUG:+--enable-debug} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ diff --git a/8.1-rc/bullseye/cli/Dockerfile b/8.1-rc/bullseye/cli/Dockerfile index 1c86b83017..0b9d9bf546 100644 --- a/8.1-rc/bullseye/cli/Dockerfile +++ b/8.1-rc/bullseye/cli/Dockerfile @@ -6,6 +6,9 @@ FROM debian:bullseye-slim +# Enables debug image when built with: --build-arg DEBUG=1 +ARG DEBUG + # prevent Debian's PHP packages from being installed # https://github.com/docker-library/php/pull/542 RUN set -eux; \ @@ -174,6 +177,7 @@ RUN set -eux; \ \ # https://github.com/docker-library/php/pull/939#issuecomment-730501748 --enable-embed \ + ${DEBUG:+--enable-debug} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ diff --git a/8.1-rc/bullseye/fpm/Dockerfile b/8.1-rc/bullseye/fpm/Dockerfile index 968629effc..f47a44569d 100644 --- a/8.1-rc/bullseye/fpm/Dockerfile +++ b/8.1-rc/bullseye/fpm/Dockerfile @@ -6,6 +6,9 @@ FROM debian:bullseye-slim +# Enables debug image when built with: --build-arg DEBUG=1 +ARG DEBUG + # prevent Debian's PHP packages from being installed # https://github.com/docker-library/php/pull/542 RUN set -eux; \ @@ -176,6 +179,7 @@ RUN set -eux; \ --enable-fpm \ --with-fpm-user=www-data \ --with-fpm-group=www-data \ + ${DEBUG:+--enable-debug} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ diff --git a/8.1-rc/bullseye/zts/Dockerfile b/8.1-rc/bullseye/zts/Dockerfile index bff959bd0f..b4d90893bf 100644 --- a/8.1-rc/bullseye/zts/Dockerfile +++ b/8.1-rc/bullseye/zts/Dockerfile @@ -6,6 +6,9 @@ FROM debian:bullseye-slim +# Enables debug image when built with: --build-arg DEBUG=1 +ARG DEBUG + # prevent Debian's PHP packages from being installed # https://github.com/docker-library/php/pull/542 RUN set -eux; \ @@ -177,6 +180,7 @@ RUN set -eux; \ --enable-embed \ \ --enable-zts \ + ${DEBUG:+--enable-debug} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ diff --git a/8.1-rc/buster/apache/Dockerfile b/8.1-rc/buster/apache/Dockerfile index 249087c189..25a2b565a0 100644 --- a/8.1-rc/buster/apache/Dockerfile +++ b/8.1-rc/buster/apache/Dockerfile @@ -6,6 +6,9 @@ FROM debian:buster-slim +# Enables debug image when built with: --build-arg DEBUG=1 +ARG DEBUG + # prevent Debian's PHP packages from being installed # https://github.com/docker-library/php/pull/542 RUN set -eux; \ @@ -233,6 +236,7 @@ RUN set -eux; \ --disable-cgi \ \ --with-apxs2 \ + ${DEBUG:+--enable-debug} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ diff --git a/8.1-rc/buster/cli/Dockerfile b/8.1-rc/buster/cli/Dockerfile index f0f7e7ed90..df29f4df70 100644 --- a/8.1-rc/buster/cli/Dockerfile +++ b/8.1-rc/buster/cli/Dockerfile @@ -6,6 +6,9 @@ FROM debian:buster-slim +# Enables debug image when built with: --build-arg DEBUG=1 +ARG DEBUG + # prevent Debian's PHP packages from being installed # https://github.com/docker-library/php/pull/542 RUN set -eux; \ @@ -174,6 +177,7 @@ RUN set -eux; \ \ # https://github.com/docker-library/php/pull/939#issuecomment-730501748 --enable-embed \ + ${DEBUG:+--enable-debug} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ diff --git a/8.1-rc/buster/fpm/Dockerfile b/8.1-rc/buster/fpm/Dockerfile index 32c7c099a0..8bdca59516 100644 --- a/8.1-rc/buster/fpm/Dockerfile +++ b/8.1-rc/buster/fpm/Dockerfile @@ -6,6 +6,9 @@ FROM debian:buster-slim +# Enables debug image when built with: --build-arg DEBUG=1 +ARG DEBUG + # prevent Debian's PHP packages from being installed # https://github.com/docker-library/php/pull/542 RUN set -eux; \ @@ -176,6 +179,7 @@ RUN set -eux; \ --enable-fpm \ --with-fpm-user=www-data \ --with-fpm-group=www-data \ + ${DEBUG:+--enable-debug} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ diff --git a/8.1-rc/buster/zts/Dockerfile b/8.1-rc/buster/zts/Dockerfile index 1b2ad881a9..a4137bb737 100644 --- a/8.1-rc/buster/zts/Dockerfile +++ b/8.1-rc/buster/zts/Dockerfile @@ -6,6 +6,9 @@ FROM debian:buster-slim +# Enables debug image when built with: --build-arg DEBUG=1 +ARG DEBUG + # prevent Debian's PHP packages from being installed # https://github.com/docker-library/php/pull/542 RUN set -eux; \ @@ -177,6 +180,7 @@ RUN set -eux; \ --enable-embed \ \ --enable-zts \ + ${DEBUG:+--enable-debug} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ diff --git a/8.1/alpine3.14/cli/Dockerfile b/8.1/alpine3.14/cli/Dockerfile index bd48b267bf..2786fc3dee 100644 --- a/8.1/alpine3.14/cli/Dockerfile +++ b/8.1/alpine3.14/cli/Dockerfile @@ -6,6 +6,9 @@ FROM alpine:3.14 +# Enables debug image when built with: --build-arg DEBUG=1 +ARG DEBUG + # dependencies required for running "phpize" # these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) ENV PHPIZE_DEPS \ @@ -160,6 +163,7 @@ RUN set -eux; \ # bundled pcre does not support JIT on s390x # https://manpages.debian.org/bullseye/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT $(test "$gnuArch" = 's390x-linux-musl' && echo '--without-pcre-jit') \ + ${DEBUG:+--enable-debug} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ diff --git a/8.1/alpine3.14/fpm/Dockerfile b/8.1/alpine3.14/fpm/Dockerfile index e9564e195c..4e2f5090a0 100644 --- a/8.1/alpine3.14/fpm/Dockerfile +++ b/8.1/alpine3.14/fpm/Dockerfile @@ -6,6 +6,9 @@ FROM alpine:3.14 +# Enables debug image when built with: --build-arg DEBUG=1 +ARG DEBUG + # dependencies required for running "phpize" # these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) ENV PHPIZE_DEPS \ @@ -165,6 +168,7 @@ RUN set -eux; \ --enable-fpm \ --with-fpm-user=www-data \ --with-fpm-group=www-data \ + ${DEBUG:+--enable-debug} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ diff --git a/8.1/alpine3.15/cli/Dockerfile b/8.1/alpine3.15/cli/Dockerfile index 9bd0c1270c..ff71461549 100644 --- a/8.1/alpine3.15/cli/Dockerfile +++ b/8.1/alpine3.15/cli/Dockerfile @@ -6,6 +6,9 @@ FROM alpine:3.15 +# Enables debug image when built with: --build-arg DEBUG=1 +ARG DEBUG + # dependencies required for running "phpize" # these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) ENV PHPIZE_DEPS \ @@ -160,6 +163,7 @@ RUN set -eux; \ # bundled pcre does not support JIT on s390x # https://manpages.debian.org/bullseye/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT $(test "$gnuArch" = 's390x-linux-musl' && echo '--without-pcre-jit') \ + ${DEBUG:+--enable-debug} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ diff --git a/8.1/alpine3.15/fpm/Dockerfile b/8.1/alpine3.15/fpm/Dockerfile index e56b5ed888..15c5bcc696 100644 --- a/8.1/alpine3.15/fpm/Dockerfile +++ b/8.1/alpine3.15/fpm/Dockerfile @@ -6,6 +6,9 @@ FROM alpine:3.15 +# Enables debug image when built with: --build-arg DEBUG=1 +ARG DEBUG + # dependencies required for running "phpize" # these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) ENV PHPIZE_DEPS \ @@ -165,6 +168,7 @@ RUN set -eux; \ --enable-fpm \ --with-fpm-user=www-data \ --with-fpm-group=www-data \ + ${DEBUG:+--enable-debug} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ diff --git a/8.1/bullseye/apache/Dockerfile b/8.1/bullseye/apache/Dockerfile index 88e8b71a5c..84c111a07e 100644 --- a/8.1/bullseye/apache/Dockerfile +++ b/8.1/bullseye/apache/Dockerfile @@ -6,6 +6,9 @@ FROM debian:bullseye-slim +# Enables debug image when built with: --build-arg DEBUG=1 +ARG DEBUG + # prevent Debian's PHP packages from being installed # https://github.com/docker-library/php/pull/542 RUN set -eux; \ @@ -233,6 +236,7 @@ RUN set -eux; \ --disable-cgi \ \ --with-apxs2 \ + ${DEBUG:+--enable-debug} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ diff --git a/8.1/bullseye/cli/Dockerfile b/8.1/bullseye/cli/Dockerfile index 772924a58a..e4b57e1b2c 100644 --- a/8.1/bullseye/cli/Dockerfile +++ b/8.1/bullseye/cli/Dockerfile @@ -6,6 +6,9 @@ FROM debian:bullseye-slim +# Enables debug image when built with: --build-arg DEBUG=1 +ARG DEBUG + # prevent Debian's PHP packages from being installed # https://github.com/docker-library/php/pull/542 RUN set -eux; \ @@ -174,6 +177,7 @@ RUN set -eux; \ \ # https://github.com/docker-library/php/pull/939#issuecomment-730501748 --enable-embed \ + ${DEBUG:+--enable-debug} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ diff --git a/8.1/bullseye/fpm/Dockerfile b/8.1/bullseye/fpm/Dockerfile index 8b66a07473..b376ffa1bc 100644 --- a/8.1/bullseye/fpm/Dockerfile +++ b/8.1/bullseye/fpm/Dockerfile @@ -6,6 +6,9 @@ FROM debian:bullseye-slim +# Enables debug image when built with: --build-arg DEBUG=1 +ARG DEBUG + # prevent Debian's PHP packages from being installed # https://github.com/docker-library/php/pull/542 RUN set -eux; \ @@ -176,6 +179,7 @@ RUN set -eux; \ --enable-fpm \ --with-fpm-user=www-data \ --with-fpm-group=www-data \ + ${DEBUG:+--enable-debug} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ diff --git a/8.1/bullseye/zts/Dockerfile b/8.1/bullseye/zts/Dockerfile index 32bbb0c97b..0090bca412 100644 --- a/8.1/bullseye/zts/Dockerfile +++ b/8.1/bullseye/zts/Dockerfile @@ -6,6 +6,9 @@ FROM debian:bullseye-slim +# Enables debug image when built with: --build-arg DEBUG=1 +ARG DEBUG + # prevent Debian's PHP packages from being installed # https://github.com/docker-library/php/pull/542 RUN set -eux; \ @@ -177,6 +180,7 @@ RUN set -eux; \ --enable-embed \ \ --enable-zts \ + ${DEBUG:+--enable-debug} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ diff --git a/8.1/buster/apache/Dockerfile b/8.1/buster/apache/Dockerfile index 859919cbc8..72cf495eee 100644 --- a/8.1/buster/apache/Dockerfile +++ b/8.1/buster/apache/Dockerfile @@ -6,6 +6,9 @@ FROM debian:buster-slim +# Enables debug image when built with: --build-arg DEBUG=1 +ARG DEBUG + # prevent Debian's PHP packages from being installed # https://github.com/docker-library/php/pull/542 RUN set -eux; \ @@ -233,6 +236,7 @@ RUN set -eux; \ --disable-cgi \ \ --with-apxs2 \ + ${DEBUG:+--enable-debug} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ diff --git a/8.1/buster/cli/Dockerfile b/8.1/buster/cli/Dockerfile index 3b14ee546e..b77d2c2a8b 100644 --- a/8.1/buster/cli/Dockerfile +++ b/8.1/buster/cli/Dockerfile @@ -6,6 +6,9 @@ FROM debian:buster-slim +# Enables debug image when built with: --build-arg DEBUG=1 +ARG DEBUG + # prevent Debian's PHP packages from being installed # https://github.com/docker-library/php/pull/542 RUN set -eux; \ @@ -174,6 +177,7 @@ RUN set -eux; \ \ # https://github.com/docker-library/php/pull/939#issuecomment-730501748 --enable-embed \ + ${DEBUG:+--enable-debug} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ diff --git a/8.1/buster/fpm/Dockerfile b/8.1/buster/fpm/Dockerfile index c417b14550..eed2e56628 100644 --- a/8.1/buster/fpm/Dockerfile +++ b/8.1/buster/fpm/Dockerfile @@ -6,6 +6,9 @@ FROM debian:buster-slim +# Enables debug image when built with: --build-arg DEBUG=1 +ARG DEBUG + # prevent Debian's PHP packages from being installed # https://github.com/docker-library/php/pull/542 RUN set -eux; \ @@ -176,6 +179,7 @@ RUN set -eux; \ --enable-fpm \ --with-fpm-user=www-data \ --with-fpm-group=www-data \ + ${DEBUG:+--enable-debug} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ diff --git a/8.1/buster/zts/Dockerfile b/8.1/buster/zts/Dockerfile index d8158316ee..951a0d67ad 100644 --- a/8.1/buster/zts/Dockerfile +++ b/8.1/buster/zts/Dockerfile @@ -6,6 +6,9 @@ FROM debian:buster-slim +# Enables debug image when built with: --build-arg DEBUG=1 +ARG DEBUG + # prevent Debian's PHP packages from being installed # https://github.com/docker-library/php/pull/542 RUN set -eux; \ @@ -177,6 +180,7 @@ RUN set -eux; \ --enable-embed \ \ --enable-zts \ + ${DEBUG:+--enable-debug} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \