File tree Expand file tree Collapse file tree 4 files changed +15
-12
lines changed
Expand file tree Collapse file tree 4 files changed +15
-12
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ variable "IMAGE_VERSION_SUFFIX" {
1717variable "DOCKER_PLATFORM" {
1818 default = " linux/amd64"
1919}
20- variable "ENABLE_ZTS " {
20+ variable "PHP_COMPILATION_FLAGS " {
2121 default = " "
2222}
2323
@@ -27,7 +27,7 @@ target "build-php" {
2727 tags = [" bref/${ CPU_PREFIX } build-php-${ PHP_VERSION } " ]
2828 args = {
2929 " IMAGE_VERSION_SUFFIX" = " ${ IMAGE_VERSION_SUFFIX } "
30- " ENABLE_ZTS " = " ${ ENABLE_ZTS } "
30+ " PHP_COMPILATION_FLAGS " = " ${ PHP_COMPILATION_FLAGS } "
3131 }
3232 platforms = [" ${ DOCKER_PLATFORM } " ]
3333}
@@ -38,7 +38,7 @@ target "php" {
3838 tags = [" bref/${ CPU_PREFIX } php-${ PHP_VERSION } " ]
3939 args = {
4040 " IMAGE_VERSION_SUFFIX" = " ${ IMAGE_VERSION_SUFFIX } "
41- " ENABLE_ZTS " = " ${ ENABLE_ZTS } "
41+ " PHP_COMPILATION_FLAGS " = " ${ PHP_COMPILATION_FLAGS } "
4242 }
4343 contexts = {
4444 " bref/${CPU_PREFIX}build-php-${PHP_VERSION}" = " target:build-php"
Original file line number Diff line number Diff line change @@ -364,7 +364,7 @@ RUN curl --location --silent --show-error --fail https://www.php.net/get/php-${V
364364# --enable-ftp: because ftp_ssl_connect() needs ftp to be compiled statically (see https://github.com/docker-library/php/issues/236)
365365# --enable-mbstring: because otherwise there's no way to get pecl to use it properly (see https://github.com/docker-library/php/issues/195)
366366# --with-zlib and --with-zlib-dir: See https://stackoverflow.com/a/42978649/245552
367- ARG ENABLE_ZTS
367+ ARG PHP_COMPILATION_FLAGS
368368RUN ./buildconf --force
369369RUN CFLAGS="-fstack-protector-strong -fpic -fpie -O3 -I${INSTALL_DIR}/include -I/usr/include -ffunction-sections -fdata-sections" \
370370 CPPFLAGS="-fstack-protector-strong -fpic -fpie -O3 -I${INSTALL_DIR}/include -I/usr/include -ffunction-sections -fdata-sections" \
@@ -378,7 +378,6 @@ RUN CFLAGS="-fstack-protector-strong -fpic -fpie -O3 -I${INSTALL_DIR}/include -I
378378 --enable-fpm \
379379 --disable-cgi \
380380 --enable-cli \
381- ${ENABLE_ZTS} \
382381 --disable-phpdbg \
383382 --with-sodium \
384383 --with-readline \
@@ -400,7 +399,9 @@ RUN CFLAGS="-fstack-protector-strong -fpic -fpie -O3 -I${INSTALL_DIR}/include -I
400399 --enable-soap \
401400 --with-xsl=${INSTALL_DIR} \
402401 # necessary for `pecl` to work (to install PHP extensions)
403- --with-pear
402+ --with-pear \
403+ # extra compilation flags
404+ ${PHP_COMPILATION_FLAGS}
404405RUN make -j $(nproc)
405406# Run `make install` and override PEAR's PHAR URL because pear.php.net is down
406407RUN set -xe; \
Original file line number Diff line number Diff line change @@ -364,7 +364,7 @@ RUN curl --location --silent --show-error --fail https://www.php.net/get/php-${V
364364# --enable-ftp: because ftp_ssl_connect() needs ftp to be compiled statically (see https://github.com/docker-library/php/issues/236)
365365# --enable-mbstring: because otherwise there's no way to get pecl to use it properly (see https://github.com/docker-library/php/issues/195)
366366# --with-zlib and --with-zlib-dir: See https://stackoverflow.com/a/42978649/245552
367- ARG ENABLE_ZTS
367+ ARG PHP_COMPILATION_FLAGS
368368RUN ./buildconf --force
369369RUN CFLAGS="-fstack-protector-strong -fpic -fpie -O3 -I${INSTALL_DIR}/include -I/usr/include -ffunction-sections -fdata-sections" \
370370 CPPFLAGS="-fstack-protector-strong -fpic -fpie -O3 -I${INSTALL_DIR}/include -I/usr/include -ffunction-sections -fdata-sections" \
@@ -378,7 +378,6 @@ RUN CFLAGS="-fstack-protector-strong -fpic -fpie -O3 -I${INSTALL_DIR}/include -I
378378 --enable-fpm \
379379 --disable-cgi \
380380 --enable-cli \
381- ${ENABLE_ZTS} \
382381 --disable-phpdbg \
383382 --with-sodium \
384383 --with-readline \
@@ -400,7 +399,9 @@ RUN CFLAGS="-fstack-protector-strong -fpic -fpie -O3 -I${INSTALL_DIR}/include -I
400399 --enable-soap \
401400 --with-xsl=${INSTALL_DIR} \
402401 # necessary for `pecl` to work (to install PHP extensions)
403- --with-pear
402+ --with-pear \
403+ # extra compilation flags
404+ ${PHP_COMPILATION_FLAGS}
404405RUN make -j $(nproc)
405406# Run `make install` and override PEAR's PHAR URL because pear.php.net is down
406407RUN set -xe; \
Original file line number Diff line number Diff line change @@ -364,7 +364,7 @@ RUN curl --location --silent --show-error --fail https://www.php.net/get/php-${V
364364# --enable-ftp: because ftp_ssl_connect() needs ftp to be compiled statically (see https://github.com/docker-library/php/issues/236)
365365# --enable-mbstring: because otherwise there's no way to get pecl to use it properly (see https://github.com/docker-library/php/issues/195)
366366# --with-zlib and --with-zlib-dir: See https://stackoverflow.com/a/42978649/245552
367- ARG ENABLE_ZTS
367+ ARG PHP_COMPILATION_FLAGS
368368RUN ./buildconf --force
369369RUN CFLAGS="-fstack-protector-strong -fpic -fpie -O3 -I${INSTALL_DIR}/include -I/usr/include -ffunction-sections -fdata-sections" \
370370 CPPFLAGS="-fstack-protector-strong -fpic -fpie -O3 -I${INSTALL_DIR}/include -I/usr/include -ffunction-sections -fdata-sections" \
@@ -378,7 +378,6 @@ RUN CFLAGS="-fstack-protector-strong -fpic -fpie -O3 -I${INSTALL_DIR}/include -I
378378 --enable-fpm \
379379 --disable-cgi \
380380 --enable-cli \
381- ${ENABLE_ZTS} \
382381 --disable-phpdbg \
383382 --with-sodium \
384383 --with-readline \
@@ -400,7 +399,9 @@ RUN CFLAGS="-fstack-protector-strong -fpic -fpie -O3 -I${INSTALL_DIR}/include -I
400399 --enable-soap \
401400 --with-xsl=${INSTALL_DIR} \
402401 # necessary for `pecl` to work (to install PHP extensions)
403- --with-pear
402+ --with-pear \
403+ # extra compilation flags
404+ ${PHP_COMPILATION_FLAGS}
404405RUN make -j $(nproc)
405406# Run `make install` and override PEAR's PHAR URL because pear.php.net is down
406407RUN set -xe; \
You can’t perform that action at this time.
0 commit comments