From ac44bc54524ac458d3e1abddc74dcc803d8501ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Sat, 26 Mar 2022 16:38:02 +0100 Subject: [PATCH] Fix conditional "strip" based on "ZEND_DEBUG_BUILD" --- 7.4/alpine3.14/cli/Dockerfile | 20 ++++++++++++-------- 7.4/alpine3.14/cli/docker-php-ext-install | 1 - 7.4/alpine3.14/fpm/Dockerfile | 20 ++++++++++++-------- 7.4/alpine3.14/fpm/docker-php-ext-install | 1 - 7.4/alpine3.14/zts/Dockerfile | 20 ++++++++++++-------- 7.4/alpine3.14/zts/docker-php-ext-install | 1 - 7.4/alpine3.15/cli/Dockerfile | 20 ++++++++++++-------- 7.4/alpine3.15/cli/docker-php-ext-install | 1 - 7.4/alpine3.15/fpm/Dockerfile | 20 ++++++++++++-------- 7.4/alpine3.15/fpm/docker-php-ext-install | 1 - 7.4/alpine3.15/zts/Dockerfile | 20 ++++++++++++-------- 7.4/alpine3.15/zts/docker-php-ext-install | 1 - 7.4/bullseye/apache/Dockerfile | 20 ++++++++++++-------- 7.4/bullseye/apache/docker-php-ext-install | 1 - 7.4/bullseye/cli/Dockerfile | 20 ++++++++++++-------- 7.4/bullseye/cli/docker-php-ext-install | 1 - 7.4/bullseye/fpm/Dockerfile | 20 ++++++++++++-------- 7.4/bullseye/fpm/docker-php-ext-install | 1 - 7.4/bullseye/zts/Dockerfile | 20 ++++++++++++-------- 7.4/bullseye/zts/docker-php-ext-install | 1 - 7.4/buster/apache/Dockerfile | 20 ++++++++++++-------- 7.4/buster/apache/docker-php-ext-install | 1 - 7.4/buster/cli/Dockerfile | 20 ++++++++++++-------- 7.4/buster/cli/docker-php-ext-install | 1 - 7.4/buster/fpm/Dockerfile | 20 ++++++++++++-------- 7.4/buster/fpm/docker-php-ext-install | 1 - 7.4/buster/zts/Dockerfile | 20 ++++++++++++-------- 7.4/buster/zts/docker-php-ext-install | 1 - 8.0/alpine3.14/cli/Dockerfile | 20 ++++++++++++-------- 8.0/alpine3.14/cli/docker-php-ext-install | 1 - 8.0/alpine3.14/fpm/Dockerfile | 20 ++++++++++++-------- 8.0/alpine3.14/fpm/docker-php-ext-install | 1 - 8.0/alpine3.15/cli/Dockerfile | 20 ++++++++++++-------- 8.0/alpine3.15/cli/docker-php-ext-install | 1 - 8.0/alpine3.15/fpm/Dockerfile | 20 ++++++++++++-------- 8.0/alpine3.15/fpm/docker-php-ext-install | 1 - 8.0/bullseye/apache/Dockerfile | 20 ++++++++++++-------- 8.0/bullseye/apache/docker-php-ext-install | 1 - 8.0/bullseye/cli/Dockerfile | 20 ++++++++++++-------- 8.0/bullseye/cli/docker-php-ext-install | 1 - 8.0/bullseye/fpm/Dockerfile | 20 ++++++++++++-------- 8.0/bullseye/fpm/docker-php-ext-install | 1 - 8.0/bullseye/zts/Dockerfile | 20 ++++++++++++-------- 8.0/bullseye/zts/docker-php-ext-install | 1 - 8.0/buster/apache/Dockerfile | 20 ++++++++++++-------- 8.0/buster/apache/docker-php-ext-install | 1 - 8.0/buster/cli/Dockerfile | 20 ++++++++++++-------- 8.0/buster/cli/docker-php-ext-install | 1 - 8.0/buster/fpm/Dockerfile | 20 ++++++++++++-------- 8.0/buster/fpm/docker-php-ext-install | 1 - 8.0/buster/zts/Dockerfile | 20 ++++++++++++-------- 8.0/buster/zts/docker-php-ext-install | 1 - 8.1/alpine3.14/cli/Dockerfile | 20 ++++++++++++-------- 8.1/alpine3.14/cli/docker-php-ext-install | 1 - 8.1/alpine3.14/fpm/Dockerfile | 20 ++++++++++++-------- 8.1/alpine3.14/fpm/docker-php-ext-install | 1 - 8.1/alpine3.15/cli/Dockerfile | 20 ++++++++++++-------- 8.1/alpine3.15/cli/docker-php-ext-install | 1 - 8.1/alpine3.15/fpm/Dockerfile | 20 ++++++++++++-------- 8.1/alpine3.15/fpm/docker-php-ext-install | 1 - 8.1/bullseye/apache/Dockerfile | 20 ++++++++++++-------- 8.1/bullseye/apache/docker-php-ext-install | 1 - 8.1/bullseye/cli/Dockerfile | 20 ++++++++++++-------- 8.1/bullseye/cli/docker-php-ext-install | 1 - 8.1/bullseye/fpm/Dockerfile | 20 ++++++++++++-------- 8.1/bullseye/fpm/docker-php-ext-install | 1 - 8.1/bullseye/zts/Dockerfile | 20 ++++++++++++-------- 8.1/bullseye/zts/docker-php-ext-install | 1 - 8.1/buster/apache/Dockerfile | 20 ++++++++++++-------- 8.1/buster/apache/docker-php-ext-install | 1 - 8.1/buster/cli/Dockerfile | 20 ++++++++++++-------- 8.1/buster/cli/docker-php-ext-install | 1 - 8.1/buster/fpm/Dockerfile | 20 ++++++++++++-------- 8.1/buster/fpm/docker-php-ext-install | 1 - 8.1/buster/zts/Dockerfile | 20 ++++++++++++-------- 8.1/buster/zts/docker-php-ext-install | 1 - Dockerfile-linux.template | 20 ++++++++++++-------- docker-php-ext-install | 1 - 78 files changed, 468 insertions(+), 351 deletions(-) diff --git a/7.4/alpine3.14/cli/Dockerfile b/7.4/alpine3.14/cli/Dockerfile index 713d6b76a9..1665dc11d5 100644 --- a/7.4/alpine3.14/cli/Dockerfile +++ b/7.4/alpine3.14/cli/Dockerfile @@ -166,14 +166,18 @@ RUN set -eux; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - find \ - /usr/local \ - -type f \ - -perm '/0111' \ - -exec sh -euxc ' \ - strip --strip-all "$@" || : \ - ' -- '{}' + \ - ; \ + if ! php -n -d 'display_errors=stderr' -r 'exit(ZEND_DEBUG_BUILD ? 0 : 1);' > /dev/null; then \ + # only "strip" binaries if we aren't using a debug build of PHP + # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) + # https://github.com/docker-library/php/issues/1268 + find \ + /usr/local \ + -type f \ + -perm '/0111' \ + -exec sh -euxc ' \ + strip --strip-all "$@" || : \ + ' -- '{}' +; \ + fi; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/7.4/alpine3.14/cli/docker-php-ext-install b/7.4/alpine3.14/cli/docker-php-ext-install index aa0b96c5a3..7443721d32 100755 --- a/7.4/alpine3.14/cli/docker-php-ext-install +++ b/7.4/alpine3.14/cli/docker-php-ext-install @@ -112,7 +112,6 @@ for ext in $exts; do # only "strip" modules if we aren't using a debug build of PHP # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) # https://github.com/docker-library/php/issues/1268 - find modules \ -maxdepth 1 \ -name '*.so' \ diff --git a/7.4/alpine3.14/fpm/Dockerfile b/7.4/alpine3.14/fpm/Dockerfile index 4089e92d05..9b82f78f11 100644 --- a/7.4/alpine3.14/fpm/Dockerfile +++ b/7.4/alpine3.14/fpm/Dockerfile @@ -171,14 +171,18 @@ RUN set -eux; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - find \ - /usr/local \ - -type f \ - -perm '/0111' \ - -exec sh -euxc ' \ - strip --strip-all "$@" || : \ - ' -- '{}' + \ - ; \ + if ! php -n -d 'display_errors=stderr' -r 'exit(ZEND_DEBUG_BUILD ? 0 : 1);' > /dev/null; then \ + # only "strip" binaries if we aren't using a debug build of PHP + # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) + # https://github.com/docker-library/php/issues/1268 + find \ + /usr/local \ + -type f \ + -perm '/0111' \ + -exec sh -euxc ' \ + strip --strip-all "$@" || : \ + ' -- '{}' +; \ + fi; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/7.4/alpine3.14/fpm/docker-php-ext-install b/7.4/alpine3.14/fpm/docker-php-ext-install index aa0b96c5a3..7443721d32 100755 --- a/7.4/alpine3.14/fpm/docker-php-ext-install +++ b/7.4/alpine3.14/fpm/docker-php-ext-install @@ -112,7 +112,6 @@ for ext in $exts; do # only "strip" modules if we aren't using a debug build of PHP # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) # https://github.com/docker-library/php/issues/1268 - find modules \ -maxdepth 1 \ -name '*.so' \ diff --git a/7.4/alpine3.14/zts/Dockerfile b/7.4/alpine3.14/zts/Dockerfile index 3aed583d87..5f53ea68e6 100644 --- a/7.4/alpine3.14/zts/Dockerfile +++ b/7.4/alpine3.14/zts/Dockerfile @@ -169,14 +169,18 @@ RUN set -eux; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - find \ - /usr/local \ - -type f \ - -perm '/0111' \ - -exec sh -euxc ' \ - strip --strip-all "$@" || : \ - ' -- '{}' + \ - ; \ + if ! php -n -d 'display_errors=stderr' -r 'exit(ZEND_DEBUG_BUILD ? 0 : 1);' > /dev/null; then \ + # only "strip" binaries if we aren't using a debug build of PHP + # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) + # https://github.com/docker-library/php/issues/1268 + find \ + /usr/local \ + -type f \ + -perm '/0111' \ + -exec sh -euxc ' \ + strip --strip-all "$@" || : \ + ' -- '{}' +; \ + fi; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/7.4/alpine3.14/zts/docker-php-ext-install b/7.4/alpine3.14/zts/docker-php-ext-install index aa0b96c5a3..7443721d32 100755 --- a/7.4/alpine3.14/zts/docker-php-ext-install +++ b/7.4/alpine3.14/zts/docker-php-ext-install @@ -112,7 +112,6 @@ for ext in $exts; do # only "strip" modules if we aren't using a debug build of PHP # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) # https://github.com/docker-library/php/issues/1268 - find modules \ -maxdepth 1 \ -name '*.so' \ diff --git a/7.4/alpine3.15/cli/Dockerfile b/7.4/alpine3.15/cli/Dockerfile index ecf98da83d..09559c6373 100644 --- a/7.4/alpine3.15/cli/Dockerfile +++ b/7.4/alpine3.15/cli/Dockerfile @@ -166,14 +166,18 @@ RUN set -eux; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - find \ - /usr/local \ - -type f \ - -perm '/0111' \ - -exec sh -euxc ' \ - strip --strip-all "$@" || : \ - ' -- '{}' + \ - ; \ + if ! php -n -d 'display_errors=stderr' -r 'exit(ZEND_DEBUG_BUILD ? 0 : 1);' > /dev/null; then \ + # only "strip" binaries if we aren't using a debug build of PHP + # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) + # https://github.com/docker-library/php/issues/1268 + find \ + /usr/local \ + -type f \ + -perm '/0111' \ + -exec sh -euxc ' \ + strip --strip-all "$@" || : \ + ' -- '{}' +; \ + fi; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/7.4/alpine3.15/cli/docker-php-ext-install b/7.4/alpine3.15/cli/docker-php-ext-install index aa0b96c5a3..7443721d32 100755 --- a/7.4/alpine3.15/cli/docker-php-ext-install +++ b/7.4/alpine3.15/cli/docker-php-ext-install @@ -112,7 +112,6 @@ for ext in $exts; do # only "strip" modules if we aren't using a debug build of PHP # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) # https://github.com/docker-library/php/issues/1268 - find modules \ -maxdepth 1 \ -name '*.so' \ diff --git a/7.4/alpine3.15/fpm/Dockerfile b/7.4/alpine3.15/fpm/Dockerfile index 5768aac977..97dd0c8c0b 100644 --- a/7.4/alpine3.15/fpm/Dockerfile +++ b/7.4/alpine3.15/fpm/Dockerfile @@ -171,14 +171,18 @@ RUN set -eux; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - find \ - /usr/local \ - -type f \ - -perm '/0111' \ - -exec sh -euxc ' \ - strip --strip-all "$@" || : \ - ' -- '{}' + \ - ; \ + if ! php -n -d 'display_errors=stderr' -r 'exit(ZEND_DEBUG_BUILD ? 0 : 1);' > /dev/null; then \ + # only "strip" binaries if we aren't using a debug build of PHP + # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) + # https://github.com/docker-library/php/issues/1268 + find \ + /usr/local \ + -type f \ + -perm '/0111' \ + -exec sh -euxc ' \ + strip --strip-all "$@" || : \ + ' -- '{}' +; \ + fi; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/7.4/alpine3.15/fpm/docker-php-ext-install b/7.4/alpine3.15/fpm/docker-php-ext-install index aa0b96c5a3..7443721d32 100755 --- a/7.4/alpine3.15/fpm/docker-php-ext-install +++ b/7.4/alpine3.15/fpm/docker-php-ext-install @@ -112,7 +112,6 @@ for ext in $exts; do # only "strip" modules if we aren't using a debug build of PHP # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) # https://github.com/docker-library/php/issues/1268 - find modules \ -maxdepth 1 \ -name '*.so' \ diff --git a/7.4/alpine3.15/zts/Dockerfile b/7.4/alpine3.15/zts/Dockerfile index 3598e419f0..2a68f9474a 100644 --- a/7.4/alpine3.15/zts/Dockerfile +++ b/7.4/alpine3.15/zts/Dockerfile @@ -169,14 +169,18 @@ RUN set -eux; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - find \ - /usr/local \ - -type f \ - -perm '/0111' \ - -exec sh -euxc ' \ - strip --strip-all "$@" || : \ - ' -- '{}' + \ - ; \ + if ! php -n -d 'display_errors=stderr' -r 'exit(ZEND_DEBUG_BUILD ? 0 : 1);' > /dev/null; then \ + # only "strip" binaries if we aren't using a debug build of PHP + # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) + # https://github.com/docker-library/php/issues/1268 + find \ + /usr/local \ + -type f \ + -perm '/0111' \ + -exec sh -euxc ' \ + strip --strip-all "$@" || : \ + ' -- '{}' +; \ + fi; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/7.4/alpine3.15/zts/docker-php-ext-install b/7.4/alpine3.15/zts/docker-php-ext-install index aa0b96c5a3..7443721d32 100755 --- a/7.4/alpine3.15/zts/docker-php-ext-install +++ b/7.4/alpine3.15/zts/docker-php-ext-install @@ -112,7 +112,6 @@ for ext in $exts; do # only "strip" modules if we aren't using a debug build of PHP # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) # https://github.com/docker-library/php/issues/1268 - find modules \ -maxdepth 1 \ -name '*.so' \ diff --git a/7.4/bullseye/apache/Dockerfile b/7.4/bullseye/apache/Dockerfile index deeefcf32e..014afbff33 100644 --- a/7.4/bullseye/apache/Dockerfile +++ b/7.4/bullseye/apache/Dockerfile @@ -237,14 +237,18 @@ RUN set -eux; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - find \ - /usr/local \ - -type f \ - -perm '/0111' \ - -exec sh -euxc ' \ - strip --strip-all "$@" || : \ - ' -- '{}' + \ - ; \ + if ! php -n -d 'display_errors=stderr' -r 'exit(ZEND_DEBUG_BUILD ? 0 : 1);' > /dev/null; then \ + # only "strip" binaries if we aren't using a debug build of PHP + # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) + # https://github.com/docker-library/php/issues/1268 + find \ + /usr/local \ + -type f \ + -perm '/0111' \ + -exec sh -euxc ' \ + strip --strip-all "$@" || : \ + ' -- '{}' +; \ + fi; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/7.4/bullseye/apache/docker-php-ext-install b/7.4/bullseye/apache/docker-php-ext-install index aa0b96c5a3..7443721d32 100755 --- a/7.4/bullseye/apache/docker-php-ext-install +++ b/7.4/bullseye/apache/docker-php-ext-install @@ -112,7 +112,6 @@ for ext in $exts; do # only "strip" modules if we aren't using a debug build of PHP # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) # https://github.com/docker-library/php/issues/1268 - find modules \ -maxdepth 1 \ -name '*.so' \ diff --git a/7.4/bullseye/cli/Dockerfile b/7.4/bullseye/cli/Dockerfile index 6f7ec5db4b..42fe2c327f 100644 --- a/7.4/bullseye/cli/Dockerfile +++ b/7.4/bullseye/cli/Dockerfile @@ -178,14 +178,18 @@ RUN set -eux; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - find \ - /usr/local \ - -type f \ - -perm '/0111' \ - -exec sh -euxc ' \ - strip --strip-all "$@" || : \ - ' -- '{}' + \ - ; \ + if ! php -n -d 'display_errors=stderr' -r 'exit(ZEND_DEBUG_BUILD ? 0 : 1);' > /dev/null; then \ + # only "strip" binaries if we aren't using a debug build of PHP + # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) + # https://github.com/docker-library/php/issues/1268 + find \ + /usr/local \ + -type f \ + -perm '/0111' \ + -exec sh -euxc ' \ + strip --strip-all "$@" || : \ + ' -- '{}' +; \ + fi; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/7.4/bullseye/cli/docker-php-ext-install b/7.4/bullseye/cli/docker-php-ext-install index aa0b96c5a3..7443721d32 100755 --- a/7.4/bullseye/cli/docker-php-ext-install +++ b/7.4/bullseye/cli/docker-php-ext-install @@ -112,7 +112,6 @@ for ext in $exts; do # only "strip" modules if we aren't using a debug build of PHP # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) # https://github.com/docker-library/php/issues/1268 - find modules \ -maxdepth 1 \ -name '*.so' \ diff --git a/7.4/bullseye/fpm/Dockerfile b/7.4/bullseye/fpm/Dockerfile index 68f05e443d..9184667705 100644 --- a/7.4/bullseye/fpm/Dockerfile +++ b/7.4/bullseye/fpm/Dockerfile @@ -180,14 +180,18 @@ RUN set -eux; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - find \ - /usr/local \ - -type f \ - -perm '/0111' \ - -exec sh -euxc ' \ - strip --strip-all "$@" || : \ - ' -- '{}' + \ - ; \ + if ! php -n -d 'display_errors=stderr' -r 'exit(ZEND_DEBUG_BUILD ? 0 : 1);' > /dev/null; then \ + # only "strip" binaries if we aren't using a debug build of PHP + # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) + # https://github.com/docker-library/php/issues/1268 + find \ + /usr/local \ + -type f \ + -perm '/0111' \ + -exec sh -euxc ' \ + strip --strip-all "$@" || : \ + ' -- '{}' +; \ + fi; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/7.4/bullseye/fpm/docker-php-ext-install b/7.4/bullseye/fpm/docker-php-ext-install index aa0b96c5a3..7443721d32 100755 --- a/7.4/bullseye/fpm/docker-php-ext-install +++ b/7.4/bullseye/fpm/docker-php-ext-install @@ -112,7 +112,6 @@ for ext in $exts; do # only "strip" modules if we aren't using a debug build of PHP # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) # https://github.com/docker-library/php/issues/1268 - find modules \ -maxdepth 1 \ -name '*.so' \ diff --git a/7.4/bullseye/zts/Dockerfile b/7.4/bullseye/zts/Dockerfile index c4230aae83..a62963828e 100644 --- a/7.4/bullseye/zts/Dockerfile +++ b/7.4/bullseye/zts/Dockerfile @@ -181,14 +181,18 @@ RUN set -eux; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - find \ - /usr/local \ - -type f \ - -perm '/0111' \ - -exec sh -euxc ' \ - strip --strip-all "$@" || : \ - ' -- '{}' + \ - ; \ + if ! php -n -d 'display_errors=stderr' -r 'exit(ZEND_DEBUG_BUILD ? 0 : 1);' > /dev/null; then \ + # only "strip" binaries if we aren't using a debug build of PHP + # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) + # https://github.com/docker-library/php/issues/1268 + find \ + /usr/local \ + -type f \ + -perm '/0111' \ + -exec sh -euxc ' \ + strip --strip-all "$@" || : \ + ' -- '{}' +; \ + fi; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/7.4/bullseye/zts/docker-php-ext-install b/7.4/bullseye/zts/docker-php-ext-install index aa0b96c5a3..7443721d32 100755 --- a/7.4/bullseye/zts/docker-php-ext-install +++ b/7.4/bullseye/zts/docker-php-ext-install @@ -112,7 +112,6 @@ for ext in $exts; do # only "strip" modules if we aren't using a debug build of PHP # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) # https://github.com/docker-library/php/issues/1268 - find modules \ -maxdepth 1 \ -name '*.so' \ diff --git a/7.4/buster/apache/Dockerfile b/7.4/buster/apache/Dockerfile index 726cf0968d..71d4ca241f 100644 --- a/7.4/buster/apache/Dockerfile +++ b/7.4/buster/apache/Dockerfile @@ -237,14 +237,18 @@ RUN set -eux; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - find \ - /usr/local \ - -type f \ - -perm '/0111' \ - -exec sh -euxc ' \ - strip --strip-all "$@" || : \ - ' -- '{}' + \ - ; \ + if ! php -n -d 'display_errors=stderr' -r 'exit(ZEND_DEBUG_BUILD ? 0 : 1);' > /dev/null; then \ + # only "strip" binaries if we aren't using a debug build of PHP + # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) + # https://github.com/docker-library/php/issues/1268 + find \ + /usr/local \ + -type f \ + -perm '/0111' \ + -exec sh -euxc ' \ + strip --strip-all "$@" || : \ + ' -- '{}' +; \ + fi; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/7.4/buster/apache/docker-php-ext-install b/7.4/buster/apache/docker-php-ext-install index aa0b96c5a3..7443721d32 100755 --- a/7.4/buster/apache/docker-php-ext-install +++ b/7.4/buster/apache/docker-php-ext-install @@ -112,7 +112,6 @@ for ext in $exts; do # only "strip" modules if we aren't using a debug build of PHP # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) # https://github.com/docker-library/php/issues/1268 - find modules \ -maxdepth 1 \ -name '*.so' \ diff --git a/7.4/buster/cli/Dockerfile b/7.4/buster/cli/Dockerfile index 811f21a415..90727bad7e 100644 --- a/7.4/buster/cli/Dockerfile +++ b/7.4/buster/cli/Dockerfile @@ -178,14 +178,18 @@ RUN set -eux; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - find \ - /usr/local \ - -type f \ - -perm '/0111' \ - -exec sh -euxc ' \ - strip --strip-all "$@" || : \ - ' -- '{}' + \ - ; \ + if ! php -n -d 'display_errors=stderr' -r 'exit(ZEND_DEBUG_BUILD ? 0 : 1);' > /dev/null; then \ + # only "strip" binaries if we aren't using a debug build of PHP + # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) + # https://github.com/docker-library/php/issues/1268 + find \ + /usr/local \ + -type f \ + -perm '/0111' \ + -exec sh -euxc ' \ + strip --strip-all "$@" || : \ + ' -- '{}' +; \ + fi; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/7.4/buster/cli/docker-php-ext-install b/7.4/buster/cli/docker-php-ext-install index aa0b96c5a3..7443721d32 100755 --- a/7.4/buster/cli/docker-php-ext-install +++ b/7.4/buster/cli/docker-php-ext-install @@ -112,7 +112,6 @@ for ext in $exts; do # only "strip" modules if we aren't using a debug build of PHP # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) # https://github.com/docker-library/php/issues/1268 - find modules \ -maxdepth 1 \ -name '*.so' \ diff --git a/7.4/buster/fpm/Dockerfile b/7.4/buster/fpm/Dockerfile index dfbb537f59..c4f85858d6 100644 --- a/7.4/buster/fpm/Dockerfile +++ b/7.4/buster/fpm/Dockerfile @@ -180,14 +180,18 @@ RUN set -eux; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - find \ - /usr/local \ - -type f \ - -perm '/0111' \ - -exec sh -euxc ' \ - strip --strip-all "$@" || : \ - ' -- '{}' + \ - ; \ + if ! php -n -d 'display_errors=stderr' -r 'exit(ZEND_DEBUG_BUILD ? 0 : 1);' > /dev/null; then \ + # only "strip" binaries if we aren't using a debug build of PHP + # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) + # https://github.com/docker-library/php/issues/1268 + find \ + /usr/local \ + -type f \ + -perm '/0111' \ + -exec sh -euxc ' \ + strip --strip-all "$@" || : \ + ' -- '{}' +; \ + fi; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/7.4/buster/fpm/docker-php-ext-install b/7.4/buster/fpm/docker-php-ext-install index aa0b96c5a3..7443721d32 100755 --- a/7.4/buster/fpm/docker-php-ext-install +++ b/7.4/buster/fpm/docker-php-ext-install @@ -112,7 +112,6 @@ for ext in $exts; do # only "strip" modules if we aren't using a debug build of PHP # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) # https://github.com/docker-library/php/issues/1268 - find modules \ -maxdepth 1 \ -name '*.so' \ diff --git a/7.4/buster/zts/Dockerfile b/7.4/buster/zts/Dockerfile index ff3eb3184d..dfe0fb5b0e 100644 --- a/7.4/buster/zts/Dockerfile +++ b/7.4/buster/zts/Dockerfile @@ -181,14 +181,18 @@ RUN set -eux; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - find \ - /usr/local \ - -type f \ - -perm '/0111' \ - -exec sh -euxc ' \ - strip --strip-all "$@" || : \ - ' -- '{}' + \ - ; \ + if ! php -n -d 'display_errors=stderr' -r 'exit(ZEND_DEBUG_BUILD ? 0 : 1);' > /dev/null; then \ + # only "strip" binaries if we aren't using a debug build of PHP + # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) + # https://github.com/docker-library/php/issues/1268 + find \ + /usr/local \ + -type f \ + -perm '/0111' \ + -exec sh -euxc ' \ + strip --strip-all "$@" || : \ + ' -- '{}' +; \ + fi; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/7.4/buster/zts/docker-php-ext-install b/7.4/buster/zts/docker-php-ext-install index aa0b96c5a3..7443721d32 100755 --- a/7.4/buster/zts/docker-php-ext-install +++ b/7.4/buster/zts/docker-php-ext-install @@ -112,7 +112,6 @@ for ext in $exts; do # only "strip" modules if we aren't using a debug build of PHP # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) # https://github.com/docker-library/php/issues/1268 - find modules \ -maxdepth 1 \ -name '*.so' \ diff --git a/8.0/alpine3.14/cli/Dockerfile b/8.0/alpine3.14/cli/Dockerfile index 1bbe7774e5..b434b6bd51 100644 --- a/8.0/alpine3.14/cli/Dockerfile +++ b/8.0/alpine3.14/cli/Dockerfile @@ -164,14 +164,18 @@ RUN set -eux; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - find \ - /usr/local \ - -type f \ - -perm '/0111' \ - -exec sh -euxc ' \ - strip --strip-all "$@" || : \ - ' -- '{}' + \ - ; \ + if ! php -n -d 'display_errors=stderr' -r 'exit(ZEND_DEBUG_BUILD ? 0 : 1);' > /dev/null; then \ + # only "strip" binaries if we aren't using a debug build of PHP + # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) + # https://github.com/docker-library/php/issues/1268 + find \ + /usr/local \ + -type f \ + -perm '/0111' \ + -exec sh -euxc ' \ + strip --strip-all "$@" || : \ + ' -- '{}' +; \ + fi; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/8.0/alpine3.14/cli/docker-php-ext-install b/8.0/alpine3.14/cli/docker-php-ext-install index aa0b96c5a3..7443721d32 100755 --- a/8.0/alpine3.14/cli/docker-php-ext-install +++ b/8.0/alpine3.14/cli/docker-php-ext-install @@ -112,7 +112,6 @@ for ext in $exts; do # only "strip" modules if we aren't using a debug build of PHP # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) # https://github.com/docker-library/php/issues/1268 - find modules \ -maxdepth 1 \ -name '*.so' \ diff --git a/8.0/alpine3.14/fpm/Dockerfile b/8.0/alpine3.14/fpm/Dockerfile index 75fcee0041..cae4e6c355 100644 --- a/8.0/alpine3.14/fpm/Dockerfile +++ b/8.0/alpine3.14/fpm/Dockerfile @@ -169,14 +169,18 @@ RUN set -eux; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - find \ - /usr/local \ - -type f \ - -perm '/0111' \ - -exec sh -euxc ' \ - strip --strip-all "$@" || : \ - ' -- '{}' + \ - ; \ + if ! php -n -d 'display_errors=stderr' -r 'exit(ZEND_DEBUG_BUILD ? 0 : 1);' > /dev/null; then \ + # only "strip" binaries if we aren't using a debug build of PHP + # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) + # https://github.com/docker-library/php/issues/1268 + find \ + /usr/local \ + -type f \ + -perm '/0111' \ + -exec sh -euxc ' \ + strip --strip-all "$@" || : \ + ' -- '{}' +; \ + fi; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/8.0/alpine3.14/fpm/docker-php-ext-install b/8.0/alpine3.14/fpm/docker-php-ext-install index aa0b96c5a3..7443721d32 100755 --- a/8.0/alpine3.14/fpm/docker-php-ext-install +++ b/8.0/alpine3.14/fpm/docker-php-ext-install @@ -112,7 +112,6 @@ for ext in $exts; do # only "strip" modules if we aren't using a debug build of PHP # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) # https://github.com/docker-library/php/issues/1268 - find modules \ -maxdepth 1 \ -name '*.so' \ diff --git a/8.0/alpine3.15/cli/Dockerfile b/8.0/alpine3.15/cli/Dockerfile index 60ba5cafaf..2de608eff2 100644 --- a/8.0/alpine3.15/cli/Dockerfile +++ b/8.0/alpine3.15/cli/Dockerfile @@ -164,14 +164,18 @@ RUN set -eux; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - find \ - /usr/local \ - -type f \ - -perm '/0111' \ - -exec sh -euxc ' \ - strip --strip-all "$@" || : \ - ' -- '{}' + \ - ; \ + if ! php -n -d 'display_errors=stderr' -r 'exit(ZEND_DEBUG_BUILD ? 0 : 1);' > /dev/null; then \ + # only "strip" binaries if we aren't using a debug build of PHP + # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) + # https://github.com/docker-library/php/issues/1268 + find \ + /usr/local \ + -type f \ + -perm '/0111' \ + -exec sh -euxc ' \ + strip --strip-all "$@" || : \ + ' -- '{}' +; \ + fi; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/8.0/alpine3.15/cli/docker-php-ext-install b/8.0/alpine3.15/cli/docker-php-ext-install index aa0b96c5a3..7443721d32 100755 --- a/8.0/alpine3.15/cli/docker-php-ext-install +++ b/8.0/alpine3.15/cli/docker-php-ext-install @@ -112,7 +112,6 @@ for ext in $exts; do # only "strip" modules if we aren't using a debug build of PHP # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) # https://github.com/docker-library/php/issues/1268 - find modules \ -maxdepth 1 \ -name '*.so' \ diff --git a/8.0/alpine3.15/fpm/Dockerfile b/8.0/alpine3.15/fpm/Dockerfile index 906e40b81e..3487346b5c 100644 --- a/8.0/alpine3.15/fpm/Dockerfile +++ b/8.0/alpine3.15/fpm/Dockerfile @@ -169,14 +169,18 @@ RUN set -eux; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - find \ - /usr/local \ - -type f \ - -perm '/0111' \ - -exec sh -euxc ' \ - strip --strip-all "$@" || : \ - ' -- '{}' + \ - ; \ + if ! php -n -d 'display_errors=stderr' -r 'exit(ZEND_DEBUG_BUILD ? 0 : 1);' > /dev/null; then \ + # only "strip" binaries if we aren't using a debug build of PHP + # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) + # https://github.com/docker-library/php/issues/1268 + find \ + /usr/local \ + -type f \ + -perm '/0111' \ + -exec sh -euxc ' \ + strip --strip-all "$@" || : \ + ' -- '{}' +; \ + fi; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/8.0/alpine3.15/fpm/docker-php-ext-install b/8.0/alpine3.15/fpm/docker-php-ext-install index aa0b96c5a3..7443721d32 100755 --- a/8.0/alpine3.15/fpm/docker-php-ext-install +++ b/8.0/alpine3.15/fpm/docker-php-ext-install @@ -112,7 +112,6 @@ for ext in $exts; do # only "strip" modules if we aren't using a debug build of PHP # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) # https://github.com/docker-library/php/issues/1268 - find modules \ -maxdepth 1 \ -name '*.so' \ diff --git a/8.0/bullseye/apache/Dockerfile b/8.0/bullseye/apache/Dockerfile index db8ae00153..20858acb72 100644 --- a/8.0/bullseye/apache/Dockerfile +++ b/8.0/bullseye/apache/Dockerfile @@ -237,14 +237,18 @@ RUN set -eux; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - find \ - /usr/local \ - -type f \ - -perm '/0111' \ - -exec sh -euxc ' \ - strip --strip-all "$@" || : \ - ' -- '{}' + \ - ; \ + if ! php -n -d 'display_errors=stderr' -r 'exit(ZEND_DEBUG_BUILD ? 0 : 1);' > /dev/null; then \ + # only "strip" binaries if we aren't using a debug build of PHP + # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) + # https://github.com/docker-library/php/issues/1268 + find \ + /usr/local \ + -type f \ + -perm '/0111' \ + -exec sh -euxc ' \ + strip --strip-all "$@" || : \ + ' -- '{}' +; \ + fi; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/8.0/bullseye/apache/docker-php-ext-install b/8.0/bullseye/apache/docker-php-ext-install index aa0b96c5a3..7443721d32 100755 --- a/8.0/bullseye/apache/docker-php-ext-install +++ b/8.0/bullseye/apache/docker-php-ext-install @@ -112,7 +112,6 @@ for ext in $exts; do # only "strip" modules if we aren't using a debug build of PHP # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) # https://github.com/docker-library/php/issues/1268 - find modules \ -maxdepth 1 \ -name '*.so' \ diff --git a/8.0/bullseye/cli/Dockerfile b/8.0/bullseye/cli/Dockerfile index 3d1d799370..1877d2bf8e 100644 --- a/8.0/bullseye/cli/Dockerfile +++ b/8.0/bullseye/cli/Dockerfile @@ -178,14 +178,18 @@ RUN set -eux; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - find \ - /usr/local \ - -type f \ - -perm '/0111' \ - -exec sh -euxc ' \ - strip --strip-all "$@" || : \ - ' -- '{}' + \ - ; \ + if ! php -n -d 'display_errors=stderr' -r 'exit(ZEND_DEBUG_BUILD ? 0 : 1);' > /dev/null; then \ + # only "strip" binaries if we aren't using a debug build of PHP + # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) + # https://github.com/docker-library/php/issues/1268 + find \ + /usr/local \ + -type f \ + -perm '/0111' \ + -exec sh -euxc ' \ + strip --strip-all "$@" || : \ + ' -- '{}' +; \ + fi; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/8.0/bullseye/cli/docker-php-ext-install b/8.0/bullseye/cli/docker-php-ext-install index aa0b96c5a3..7443721d32 100755 --- a/8.0/bullseye/cli/docker-php-ext-install +++ b/8.0/bullseye/cli/docker-php-ext-install @@ -112,7 +112,6 @@ for ext in $exts; do # only "strip" modules if we aren't using a debug build of PHP # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) # https://github.com/docker-library/php/issues/1268 - find modules \ -maxdepth 1 \ -name '*.so' \ diff --git a/8.0/bullseye/fpm/Dockerfile b/8.0/bullseye/fpm/Dockerfile index 69dd88f68c..ab06aa6d56 100644 --- a/8.0/bullseye/fpm/Dockerfile +++ b/8.0/bullseye/fpm/Dockerfile @@ -180,14 +180,18 @@ RUN set -eux; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - find \ - /usr/local \ - -type f \ - -perm '/0111' \ - -exec sh -euxc ' \ - strip --strip-all "$@" || : \ - ' -- '{}' + \ - ; \ + if ! php -n -d 'display_errors=stderr' -r 'exit(ZEND_DEBUG_BUILD ? 0 : 1);' > /dev/null; then \ + # only "strip" binaries if we aren't using a debug build of PHP + # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) + # https://github.com/docker-library/php/issues/1268 + find \ + /usr/local \ + -type f \ + -perm '/0111' \ + -exec sh -euxc ' \ + strip --strip-all "$@" || : \ + ' -- '{}' +; \ + fi; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/8.0/bullseye/fpm/docker-php-ext-install b/8.0/bullseye/fpm/docker-php-ext-install index aa0b96c5a3..7443721d32 100755 --- a/8.0/bullseye/fpm/docker-php-ext-install +++ b/8.0/bullseye/fpm/docker-php-ext-install @@ -112,7 +112,6 @@ for ext in $exts; do # only "strip" modules if we aren't using a debug build of PHP # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) # https://github.com/docker-library/php/issues/1268 - find modules \ -maxdepth 1 \ -name '*.so' \ diff --git a/8.0/bullseye/zts/Dockerfile b/8.0/bullseye/zts/Dockerfile index c185311cb2..fc2027b175 100644 --- a/8.0/bullseye/zts/Dockerfile +++ b/8.0/bullseye/zts/Dockerfile @@ -181,14 +181,18 @@ RUN set -eux; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - find \ - /usr/local \ - -type f \ - -perm '/0111' \ - -exec sh -euxc ' \ - strip --strip-all "$@" || : \ - ' -- '{}' + \ - ; \ + if ! php -n -d 'display_errors=stderr' -r 'exit(ZEND_DEBUG_BUILD ? 0 : 1);' > /dev/null; then \ + # only "strip" binaries if we aren't using a debug build of PHP + # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) + # https://github.com/docker-library/php/issues/1268 + find \ + /usr/local \ + -type f \ + -perm '/0111' \ + -exec sh -euxc ' \ + strip --strip-all "$@" || : \ + ' -- '{}' +; \ + fi; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/8.0/bullseye/zts/docker-php-ext-install b/8.0/bullseye/zts/docker-php-ext-install index aa0b96c5a3..7443721d32 100755 --- a/8.0/bullseye/zts/docker-php-ext-install +++ b/8.0/bullseye/zts/docker-php-ext-install @@ -112,7 +112,6 @@ for ext in $exts; do # only "strip" modules if we aren't using a debug build of PHP # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) # https://github.com/docker-library/php/issues/1268 - find modules \ -maxdepth 1 \ -name '*.so' \ diff --git a/8.0/buster/apache/Dockerfile b/8.0/buster/apache/Dockerfile index 9d26fa910b..25704e22b0 100644 --- a/8.0/buster/apache/Dockerfile +++ b/8.0/buster/apache/Dockerfile @@ -237,14 +237,18 @@ RUN set -eux; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - find \ - /usr/local \ - -type f \ - -perm '/0111' \ - -exec sh -euxc ' \ - strip --strip-all "$@" || : \ - ' -- '{}' + \ - ; \ + if ! php -n -d 'display_errors=stderr' -r 'exit(ZEND_DEBUG_BUILD ? 0 : 1);' > /dev/null; then \ + # only "strip" binaries if we aren't using a debug build of PHP + # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) + # https://github.com/docker-library/php/issues/1268 + find \ + /usr/local \ + -type f \ + -perm '/0111' \ + -exec sh -euxc ' \ + strip --strip-all "$@" || : \ + ' -- '{}' +; \ + fi; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/8.0/buster/apache/docker-php-ext-install b/8.0/buster/apache/docker-php-ext-install index aa0b96c5a3..7443721d32 100755 --- a/8.0/buster/apache/docker-php-ext-install +++ b/8.0/buster/apache/docker-php-ext-install @@ -112,7 +112,6 @@ for ext in $exts; do # only "strip" modules if we aren't using a debug build of PHP # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) # https://github.com/docker-library/php/issues/1268 - find modules \ -maxdepth 1 \ -name '*.so' \ diff --git a/8.0/buster/cli/Dockerfile b/8.0/buster/cli/Dockerfile index 718f1013ea..f6f9b78286 100644 --- a/8.0/buster/cli/Dockerfile +++ b/8.0/buster/cli/Dockerfile @@ -178,14 +178,18 @@ RUN set -eux; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - find \ - /usr/local \ - -type f \ - -perm '/0111' \ - -exec sh -euxc ' \ - strip --strip-all "$@" || : \ - ' -- '{}' + \ - ; \ + if ! php -n -d 'display_errors=stderr' -r 'exit(ZEND_DEBUG_BUILD ? 0 : 1);' > /dev/null; then \ + # only "strip" binaries if we aren't using a debug build of PHP + # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) + # https://github.com/docker-library/php/issues/1268 + find \ + /usr/local \ + -type f \ + -perm '/0111' \ + -exec sh -euxc ' \ + strip --strip-all "$@" || : \ + ' -- '{}' +; \ + fi; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/8.0/buster/cli/docker-php-ext-install b/8.0/buster/cli/docker-php-ext-install index aa0b96c5a3..7443721d32 100755 --- a/8.0/buster/cli/docker-php-ext-install +++ b/8.0/buster/cli/docker-php-ext-install @@ -112,7 +112,6 @@ for ext in $exts; do # only "strip" modules if we aren't using a debug build of PHP # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) # https://github.com/docker-library/php/issues/1268 - find modules \ -maxdepth 1 \ -name '*.so' \ diff --git a/8.0/buster/fpm/Dockerfile b/8.0/buster/fpm/Dockerfile index 2a84558eb0..bf9b9102cb 100644 --- a/8.0/buster/fpm/Dockerfile +++ b/8.0/buster/fpm/Dockerfile @@ -180,14 +180,18 @@ RUN set -eux; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - find \ - /usr/local \ - -type f \ - -perm '/0111' \ - -exec sh -euxc ' \ - strip --strip-all "$@" || : \ - ' -- '{}' + \ - ; \ + if ! php -n -d 'display_errors=stderr' -r 'exit(ZEND_DEBUG_BUILD ? 0 : 1);' > /dev/null; then \ + # only "strip" binaries if we aren't using a debug build of PHP + # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) + # https://github.com/docker-library/php/issues/1268 + find \ + /usr/local \ + -type f \ + -perm '/0111' \ + -exec sh -euxc ' \ + strip --strip-all "$@" || : \ + ' -- '{}' +; \ + fi; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/8.0/buster/fpm/docker-php-ext-install b/8.0/buster/fpm/docker-php-ext-install index aa0b96c5a3..7443721d32 100755 --- a/8.0/buster/fpm/docker-php-ext-install +++ b/8.0/buster/fpm/docker-php-ext-install @@ -112,7 +112,6 @@ for ext in $exts; do # only "strip" modules if we aren't using a debug build of PHP # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) # https://github.com/docker-library/php/issues/1268 - find modules \ -maxdepth 1 \ -name '*.so' \ diff --git a/8.0/buster/zts/Dockerfile b/8.0/buster/zts/Dockerfile index 4d9c224bb0..e858c0e97e 100644 --- a/8.0/buster/zts/Dockerfile +++ b/8.0/buster/zts/Dockerfile @@ -181,14 +181,18 @@ RUN set -eux; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - find \ - /usr/local \ - -type f \ - -perm '/0111' \ - -exec sh -euxc ' \ - strip --strip-all "$@" || : \ - ' -- '{}' + \ - ; \ + if ! php -n -d 'display_errors=stderr' -r 'exit(ZEND_DEBUG_BUILD ? 0 : 1);' > /dev/null; then \ + # only "strip" binaries if we aren't using a debug build of PHP + # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) + # https://github.com/docker-library/php/issues/1268 + find \ + /usr/local \ + -type f \ + -perm '/0111' \ + -exec sh -euxc ' \ + strip --strip-all "$@" || : \ + ' -- '{}' +; \ + fi; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/8.0/buster/zts/docker-php-ext-install b/8.0/buster/zts/docker-php-ext-install index aa0b96c5a3..7443721d32 100755 --- a/8.0/buster/zts/docker-php-ext-install +++ b/8.0/buster/zts/docker-php-ext-install @@ -112,7 +112,6 @@ for ext in $exts; do # only "strip" modules if we aren't using a debug build of PHP # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) # https://github.com/docker-library/php/issues/1268 - find modules \ -maxdepth 1 \ -name '*.so' \ diff --git a/8.1/alpine3.14/cli/Dockerfile b/8.1/alpine3.14/cli/Dockerfile index bd48b267bf..caf32a78d6 100644 --- a/8.1/alpine3.14/cli/Dockerfile +++ b/8.1/alpine3.14/cli/Dockerfile @@ -164,14 +164,18 @@ RUN set -eux; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - find \ - /usr/local \ - -type f \ - -perm '/0111' \ - -exec sh -euxc ' \ - strip --strip-all "$@" || : \ - ' -- '{}' + \ - ; \ + if ! php -n -d 'display_errors=stderr' -r 'exit(ZEND_DEBUG_BUILD ? 0 : 1);' > /dev/null; then \ + # only "strip" binaries if we aren't using a debug build of PHP + # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) + # https://github.com/docker-library/php/issues/1268 + find \ + /usr/local \ + -type f \ + -perm '/0111' \ + -exec sh -euxc ' \ + strip --strip-all "$@" || : \ + ' -- '{}' +; \ + fi; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/8.1/alpine3.14/cli/docker-php-ext-install b/8.1/alpine3.14/cli/docker-php-ext-install index aa0b96c5a3..7443721d32 100755 --- a/8.1/alpine3.14/cli/docker-php-ext-install +++ b/8.1/alpine3.14/cli/docker-php-ext-install @@ -112,7 +112,6 @@ for ext in $exts; do # only "strip" modules if we aren't using a debug build of PHP # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) # https://github.com/docker-library/php/issues/1268 - find modules \ -maxdepth 1 \ -name '*.so' \ diff --git a/8.1/alpine3.14/fpm/Dockerfile b/8.1/alpine3.14/fpm/Dockerfile index e9564e195c..9338963d57 100644 --- a/8.1/alpine3.14/fpm/Dockerfile +++ b/8.1/alpine3.14/fpm/Dockerfile @@ -169,14 +169,18 @@ RUN set -eux; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - find \ - /usr/local \ - -type f \ - -perm '/0111' \ - -exec sh -euxc ' \ - strip --strip-all "$@" || : \ - ' -- '{}' + \ - ; \ + if ! php -n -d 'display_errors=stderr' -r 'exit(ZEND_DEBUG_BUILD ? 0 : 1);' > /dev/null; then \ + # only "strip" binaries if we aren't using a debug build of PHP + # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) + # https://github.com/docker-library/php/issues/1268 + find \ + /usr/local \ + -type f \ + -perm '/0111' \ + -exec sh -euxc ' \ + strip --strip-all "$@" || : \ + ' -- '{}' +; \ + fi; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/8.1/alpine3.14/fpm/docker-php-ext-install b/8.1/alpine3.14/fpm/docker-php-ext-install index aa0b96c5a3..7443721d32 100755 --- a/8.1/alpine3.14/fpm/docker-php-ext-install +++ b/8.1/alpine3.14/fpm/docker-php-ext-install @@ -112,7 +112,6 @@ for ext in $exts; do # only "strip" modules if we aren't using a debug build of PHP # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) # https://github.com/docker-library/php/issues/1268 - find modules \ -maxdepth 1 \ -name '*.so' \ diff --git a/8.1/alpine3.15/cli/Dockerfile b/8.1/alpine3.15/cli/Dockerfile index 9bd0c1270c..ef6b0387af 100644 --- a/8.1/alpine3.15/cli/Dockerfile +++ b/8.1/alpine3.15/cli/Dockerfile @@ -164,14 +164,18 @@ RUN set -eux; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - find \ - /usr/local \ - -type f \ - -perm '/0111' \ - -exec sh -euxc ' \ - strip --strip-all "$@" || : \ - ' -- '{}' + \ - ; \ + if ! php -n -d 'display_errors=stderr' -r 'exit(ZEND_DEBUG_BUILD ? 0 : 1);' > /dev/null; then \ + # only "strip" binaries if we aren't using a debug build of PHP + # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) + # https://github.com/docker-library/php/issues/1268 + find \ + /usr/local \ + -type f \ + -perm '/0111' \ + -exec sh -euxc ' \ + strip --strip-all "$@" || : \ + ' -- '{}' +; \ + fi; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/8.1/alpine3.15/cli/docker-php-ext-install b/8.1/alpine3.15/cli/docker-php-ext-install index aa0b96c5a3..7443721d32 100755 --- a/8.1/alpine3.15/cli/docker-php-ext-install +++ b/8.1/alpine3.15/cli/docker-php-ext-install @@ -112,7 +112,6 @@ for ext in $exts; do # only "strip" modules if we aren't using a debug build of PHP # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) # https://github.com/docker-library/php/issues/1268 - find modules \ -maxdepth 1 \ -name '*.so' \ diff --git a/8.1/alpine3.15/fpm/Dockerfile b/8.1/alpine3.15/fpm/Dockerfile index e56b5ed888..2ef8230df3 100644 --- a/8.1/alpine3.15/fpm/Dockerfile +++ b/8.1/alpine3.15/fpm/Dockerfile @@ -169,14 +169,18 @@ RUN set -eux; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - find \ - /usr/local \ - -type f \ - -perm '/0111' \ - -exec sh -euxc ' \ - strip --strip-all "$@" || : \ - ' -- '{}' + \ - ; \ + if ! php -n -d 'display_errors=stderr' -r 'exit(ZEND_DEBUG_BUILD ? 0 : 1);' > /dev/null; then \ + # only "strip" binaries if we aren't using a debug build of PHP + # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) + # https://github.com/docker-library/php/issues/1268 + find \ + /usr/local \ + -type f \ + -perm '/0111' \ + -exec sh -euxc ' \ + strip --strip-all "$@" || : \ + ' -- '{}' +; \ + fi; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/8.1/alpine3.15/fpm/docker-php-ext-install b/8.1/alpine3.15/fpm/docker-php-ext-install index aa0b96c5a3..7443721d32 100755 --- a/8.1/alpine3.15/fpm/docker-php-ext-install +++ b/8.1/alpine3.15/fpm/docker-php-ext-install @@ -112,7 +112,6 @@ for ext in $exts; do # only "strip" modules if we aren't using a debug build of PHP # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) # https://github.com/docker-library/php/issues/1268 - find modules \ -maxdepth 1 \ -name '*.so' \ diff --git a/8.1/bullseye/apache/Dockerfile b/8.1/bullseye/apache/Dockerfile index 88e8b71a5c..8b1eff47a8 100644 --- a/8.1/bullseye/apache/Dockerfile +++ b/8.1/bullseye/apache/Dockerfile @@ -237,14 +237,18 @@ RUN set -eux; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - find \ - /usr/local \ - -type f \ - -perm '/0111' \ - -exec sh -euxc ' \ - strip --strip-all "$@" || : \ - ' -- '{}' + \ - ; \ + if ! php -n -d 'display_errors=stderr' -r 'exit(ZEND_DEBUG_BUILD ? 0 : 1);' > /dev/null; then \ + # only "strip" binaries if we aren't using a debug build of PHP + # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) + # https://github.com/docker-library/php/issues/1268 + find \ + /usr/local \ + -type f \ + -perm '/0111' \ + -exec sh -euxc ' \ + strip --strip-all "$@" || : \ + ' -- '{}' +; \ + fi; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/8.1/bullseye/apache/docker-php-ext-install b/8.1/bullseye/apache/docker-php-ext-install index aa0b96c5a3..7443721d32 100755 --- a/8.1/bullseye/apache/docker-php-ext-install +++ b/8.1/bullseye/apache/docker-php-ext-install @@ -112,7 +112,6 @@ for ext in $exts; do # only "strip" modules if we aren't using a debug build of PHP # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) # https://github.com/docker-library/php/issues/1268 - find modules \ -maxdepth 1 \ -name '*.so' \ diff --git a/8.1/bullseye/cli/Dockerfile b/8.1/bullseye/cli/Dockerfile index 772924a58a..05952877b0 100644 --- a/8.1/bullseye/cli/Dockerfile +++ b/8.1/bullseye/cli/Dockerfile @@ -178,14 +178,18 @@ RUN set -eux; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - find \ - /usr/local \ - -type f \ - -perm '/0111' \ - -exec sh -euxc ' \ - strip --strip-all "$@" || : \ - ' -- '{}' + \ - ; \ + if ! php -n -d 'display_errors=stderr' -r 'exit(ZEND_DEBUG_BUILD ? 0 : 1);' > /dev/null; then \ + # only "strip" binaries if we aren't using a debug build of PHP + # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) + # https://github.com/docker-library/php/issues/1268 + find \ + /usr/local \ + -type f \ + -perm '/0111' \ + -exec sh -euxc ' \ + strip --strip-all "$@" || : \ + ' -- '{}' +; \ + fi; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/8.1/bullseye/cli/docker-php-ext-install b/8.1/bullseye/cli/docker-php-ext-install index aa0b96c5a3..7443721d32 100755 --- a/8.1/bullseye/cli/docker-php-ext-install +++ b/8.1/bullseye/cli/docker-php-ext-install @@ -112,7 +112,6 @@ for ext in $exts; do # only "strip" modules if we aren't using a debug build of PHP # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) # https://github.com/docker-library/php/issues/1268 - find modules \ -maxdepth 1 \ -name '*.so' \ diff --git a/8.1/bullseye/fpm/Dockerfile b/8.1/bullseye/fpm/Dockerfile index 8b66a07473..4f0e9c94a8 100644 --- a/8.1/bullseye/fpm/Dockerfile +++ b/8.1/bullseye/fpm/Dockerfile @@ -180,14 +180,18 @@ RUN set -eux; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - find \ - /usr/local \ - -type f \ - -perm '/0111' \ - -exec sh -euxc ' \ - strip --strip-all "$@" || : \ - ' -- '{}' + \ - ; \ + if ! php -n -d 'display_errors=stderr' -r 'exit(ZEND_DEBUG_BUILD ? 0 : 1);' > /dev/null; then \ + # only "strip" binaries if we aren't using a debug build of PHP + # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) + # https://github.com/docker-library/php/issues/1268 + find \ + /usr/local \ + -type f \ + -perm '/0111' \ + -exec sh -euxc ' \ + strip --strip-all "$@" || : \ + ' -- '{}' +; \ + fi; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/8.1/bullseye/fpm/docker-php-ext-install b/8.1/bullseye/fpm/docker-php-ext-install index aa0b96c5a3..7443721d32 100755 --- a/8.1/bullseye/fpm/docker-php-ext-install +++ b/8.1/bullseye/fpm/docker-php-ext-install @@ -112,7 +112,6 @@ for ext in $exts; do # only "strip" modules if we aren't using a debug build of PHP # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) # https://github.com/docker-library/php/issues/1268 - find modules \ -maxdepth 1 \ -name '*.so' \ diff --git a/8.1/bullseye/zts/Dockerfile b/8.1/bullseye/zts/Dockerfile index 32bbb0c97b..a598c9cc1d 100644 --- a/8.1/bullseye/zts/Dockerfile +++ b/8.1/bullseye/zts/Dockerfile @@ -181,14 +181,18 @@ RUN set -eux; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - find \ - /usr/local \ - -type f \ - -perm '/0111' \ - -exec sh -euxc ' \ - strip --strip-all "$@" || : \ - ' -- '{}' + \ - ; \ + if ! php -n -d 'display_errors=stderr' -r 'exit(ZEND_DEBUG_BUILD ? 0 : 1);' > /dev/null; then \ + # only "strip" binaries if we aren't using a debug build of PHP + # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) + # https://github.com/docker-library/php/issues/1268 + find \ + /usr/local \ + -type f \ + -perm '/0111' \ + -exec sh -euxc ' \ + strip --strip-all "$@" || : \ + ' -- '{}' +; \ + fi; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/8.1/bullseye/zts/docker-php-ext-install b/8.1/bullseye/zts/docker-php-ext-install index aa0b96c5a3..7443721d32 100755 --- a/8.1/bullseye/zts/docker-php-ext-install +++ b/8.1/bullseye/zts/docker-php-ext-install @@ -112,7 +112,6 @@ for ext in $exts; do # only "strip" modules if we aren't using a debug build of PHP # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) # https://github.com/docker-library/php/issues/1268 - find modules \ -maxdepth 1 \ -name '*.so' \ diff --git a/8.1/buster/apache/Dockerfile b/8.1/buster/apache/Dockerfile index 859919cbc8..80df0d23cb 100644 --- a/8.1/buster/apache/Dockerfile +++ b/8.1/buster/apache/Dockerfile @@ -237,14 +237,18 @@ RUN set -eux; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - find \ - /usr/local \ - -type f \ - -perm '/0111' \ - -exec sh -euxc ' \ - strip --strip-all "$@" || : \ - ' -- '{}' + \ - ; \ + if ! php -n -d 'display_errors=stderr' -r 'exit(ZEND_DEBUG_BUILD ? 0 : 1);' > /dev/null; then \ + # only "strip" binaries if we aren't using a debug build of PHP + # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) + # https://github.com/docker-library/php/issues/1268 + find \ + /usr/local \ + -type f \ + -perm '/0111' \ + -exec sh -euxc ' \ + strip --strip-all "$@" || : \ + ' -- '{}' +; \ + fi; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/8.1/buster/apache/docker-php-ext-install b/8.1/buster/apache/docker-php-ext-install index aa0b96c5a3..7443721d32 100755 --- a/8.1/buster/apache/docker-php-ext-install +++ b/8.1/buster/apache/docker-php-ext-install @@ -112,7 +112,6 @@ for ext in $exts; do # only "strip" modules if we aren't using a debug build of PHP # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) # https://github.com/docker-library/php/issues/1268 - find modules \ -maxdepth 1 \ -name '*.so' \ diff --git a/8.1/buster/cli/Dockerfile b/8.1/buster/cli/Dockerfile index 3b14ee546e..064ebbd301 100644 --- a/8.1/buster/cli/Dockerfile +++ b/8.1/buster/cli/Dockerfile @@ -178,14 +178,18 @@ RUN set -eux; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - find \ - /usr/local \ - -type f \ - -perm '/0111' \ - -exec sh -euxc ' \ - strip --strip-all "$@" || : \ - ' -- '{}' + \ - ; \ + if ! php -n -d 'display_errors=stderr' -r 'exit(ZEND_DEBUG_BUILD ? 0 : 1);' > /dev/null; then \ + # only "strip" binaries if we aren't using a debug build of PHP + # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) + # https://github.com/docker-library/php/issues/1268 + find \ + /usr/local \ + -type f \ + -perm '/0111' \ + -exec sh -euxc ' \ + strip --strip-all "$@" || : \ + ' -- '{}' +; \ + fi; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/8.1/buster/cli/docker-php-ext-install b/8.1/buster/cli/docker-php-ext-install index aa0b96c5a3..7443721d32 100755 --- a/8.1/buster/cli/docker-php-ext-install +++ b/8.1/buster/cli/docker-php-ext-install @@ -112,7 +112,6 @@ for ext in $exts; do # only "strip" modules if we aren't using a debug build of PHP # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) # https://github.com/docker-library/php/issues/1268 - find modules \ -maxdepth 1 \ -name '*.so' \ diff --git a/8.1/buster/fpm/Dockerfile b/8.1/buster/fpm/Dockerfile index c417b14550..30114f9838 100644 --- a/8.1/buster/fpm/Dockerfile +++ b/8.1/buster/fpm/Dockerfile @@ -180,14 +180,18 @@ RUN set -eux; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - find \ - /usr/local \ - -type f \ - -perm '/0111' \ - -exec sh -euxc ' \ - strip --strip-all "$@" || : \ - ' -- '{}' + \ - ; \ + if ! php -n -d 'display_errors=stderr' -r 'exit(ZEND_DEBUG_BUILD ? 0 : 1);' > /dev/null; then \ + # only "strip" binaries if we aren't using a debug build of PHP + # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) + # https://github.com/docker-library/php/issues/1268 + find \ + /usr/local \ + -type f \ + -perm '/0111' \ + -exec sh -euxc ' \ + strip --strip-all "$@" || : \ + ' -- '{}' +; \ + fi; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/8.1/buster/fpm/docker-php-ext-install b/8.1/buster/fpm/docker-php-ext-install index aa0b96c5a3..7443721d32 100755 --- a/8.1/buster/fpm/docker-php-ext-install +++ b/8.1/buster/fpm/docker-php-ext-install @@ -112,7 +112,6 @@ for ext in $exts; do # only "strip" modules if we aren't using a debug build of PHP # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) # https://github.com/docker-library/php/issues/1268 - find modules \ -maxdepth 1 \ -name '*.so' \ diff --git a/8.1/buster/zts/Dockerfile b/8.1/buster/zts/Dockerfile index d8158316ee..49858f52ca 100644 --- a/8.1/buster/zts/Dockerfile +++ b/8.1/buster/zts/Dockerfile @@ -181,14 +181,18 @@ RUN set -eux; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - find \ - /usr/local \ - -type f \ - -perm '/0111' \ - -exec sh -euxc ' \ - strip --strip-all "$@" || : \ - ' -- '{}' + \ - ; \ + if ! php -n -d 'display_errors=stderr' -r 'exit(ZEND_DEBUG_BUILD ? 0 : 1);' > /dev/null; then \ + # only "strip" binaries if we aren't using a debug build of PHP + # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) + # https://github.com/docker-library/php/issues/1268 + find \ + /usr/local \ + -type f \ + -perm '/0111' \ + -exec sh -euxc ' \ + strip --strip-all "$@" || : \ + ' -- '{}' +; \ + fi; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/8.1/buster/zts/docker-php-ext-install b/8.1/buster/zts/docker-php-ext-install index aa0b96c5a3..7443721d32 100755 --- a/8.1/buster/zts/docker-php-ext-install +++ b/8.1/buster/zts/docker-php-ext-install @@ -112,7 +112,6 @@ for ext in $exts; do # only "strip" modules if we aren't using a debug build of PHP # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) # https://github.com/docker-library/php/issues/1268 - find modules \ -maxdepth 1 \ -name '*.so' \ diff --git a/Dockerfile-linux.template b/Dockerfile-linux.template index 75a6d2d8fc..3f386f0ae0 100644 --- a/Dockerfile-linux.template +++ b/Dockerfile-linux.template @@ -389,14 +389,18 @@ RUN set -eux; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - find \ - /usr/local \ - -type f \ - -perm '/0111' \ - -exec sh -euxc ' \ - strip --strip-all "$@" || : \ - ' -- '{}' + \ - ; \ + if ! php -n -d 'display_errors=stderr' -r 'exit(ZEND_DEBUG_BUILD ? 0 : 1);' > /dev/null; then \ + # only "strip" binaries if we aren't using a debug build of PHP + # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) + # https://github.com/docker-library/php/issues/1268 + find \ + /usr/local \ + -type f \ + -perm '/0111' \ + -exec sh -euxc ' \ + strip --strip-all "$@" || : \ + ' -- '{}' +; \ + fi; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/docker-php-ext-install b/docker-php-ext-install index aa0b96c5a3..7443721d32 100755 --- a/docker-php-ext-install +++ b/docker-php-ext-install @@ -112,7 +112,6 @@ for ext in $exts; do # only "strip" modules if we aren't using a debug build of PHP # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) # https://github.com/docker-library/php/issues/1268 - find modules \ -maxdepth 1 \ -name '*.so' \