From 272a2225e7a3462cffd944f66807c76eafecee1e Mon Sep 17 00:00:00 2001 From: Joe Ferguson Date: Thu, 26 Jan 2023 14:55:33 -0800 Subject: [PATCH] Add template support for "--enable-debug" flag --- Dockerfile-linux.template | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Dockerfile-linux.template b/Dockerfile-linux.template index 034971638..6a72c8971 100644 --- a/Dockerfile-linux.template +++ b/Dockerfile-linux.template @@ -375,11 +375,18 @@ RUN set -eux; \ --enable-zts \ # https://externals.io/message/118859 --disable-zend-signals \ +{{ ) else "" end -}} +{{ if env.DOCKER_PHP_ENABLE_DEBUG then ( -}} +{{ # DOCKER_PHP_ENABLE_DEBUG is not used or supported by official-images; this is for users who want to build their own php image with debug enabled -}} +{{ # example usage to regenerate Dockerfiles with debug enabled: "DOCKER_PHP_ENABLE_DEBUG=1 ./apply-templates" -}} + --enable-debug \ {{ ) else "" end -}} ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ +{{ if env.DOCKER_PHP_ENABLE_DEBUG then "" else ( -}} +{{ # DOCKER_PHP_ENABLE_DEBUG is not used by official-images -}} find \ /usr/local \ -type f \ @@ -388,6 +395,7 @@ RUN set -eux; \ strip --strip-all "$@" || : \ ' -- '{}' + \ ; \ +{{ ) end -}} make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable)