From 794ae5084912b9266375313f17c5f70ba9c645cc Mon Sep 17 00:00:00 2001 From: Leonid Makarov Date: Fri, 4 Oct 2024 13:37:11 +0200 Subject: [PATCH 1/6] Refactor Dockerfile to use Docker PHP Extension Installer (mlocati/docker-php-extension-installer) --- 8.1/Dockerfile | 108 ++++---------------------------------------- 8.2/Dockerfile | 108 ++++---------------------------------------- 8.3/Dockerfile | 120 +++++-------------------------------------------- 3 files changed, 30 insertions(+), 306 deletions(-) diff --git a/8.1/Dockerfile b/8.1/Dockerfile index f8b85b76..58db4e46 100644 --- a/8.1/Dockerfile +++ b/8.1/Dockerfile @@ -106,60 +106,12 @@ ENV NOTVISIBLE "in users profile" # PHP RUN set -xe; \ # Note: essential build tools (g++, gcc, make, etc) are included upstream as persistent packages. - buildDeps=" \ - libc-client2007e-dev \ - libfreetype6-dev \ - libgpgme11-dev \ - libicu-dev \ - libjpeg62-turbo-dev \ - libkrb5-dev \ - libldap2-dev \ - libmagickcore-dev \ - libmagickwand-dev \ - libmemcached-dev \ - libmhash-dev \ - libpng-dev \ - libpq-dev \ - libwebp-dev \ - libssh2-1-dev \ - libxpm-dev \ - libxslt1-dev \ - libzip-dev \ - unixodbc-dev \ - "; \ - apt-get update >/dev/null; \ - apt-get -y --no-install-recommends install >/dev/null \ - $buildDeps \ - libc-client2007e \ - libfreetype6 \ - libgpgme11 \ - libicu72 \ - libjpeg62-turbo \ - libldap-2.5-0 \ - libmagickcore-6.q16-6-extra \ - libmagickwand-6.q16-6 \ - libmemcached11 \ - libmemcachedutil2 \ - libmhash2 \ - libpng16-16 \ - libpq5 \ - libssh2-1 \ - libxpm4 \ - libxslt1.1 \ - libzip4 \ - ;\ - docker-php-ext-configure >/dev/null gd \ - --with-freetype \ - --with-jpeg \ - --with-webp \ - --with-xpm; \ - PHP_OPENSSL=yes docker-php-ext-configure >/dev/null imap --with-kerberos --with-imap-ssl; \ - # Using $(uname -m) (returns x86_64 / aarch64) vs ${TARGETARCH} (returns amd64 / arm64) - docker-php-ext-configure >/dev/null ldap --with-libdir=lib/$(uname -m)-linux-gnu/; \ - docker-php-ext-configure >/dev/null pgsql --with-pgsql=/usr/local/pgsql/; \ - docker-php-ext-configure >/dev/null zip; \ - \ - docker-php-ext-install >/dev/null -j$(nproc) \ + # Docker PHP Extension Installer + curl -sSLf "https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions" -o /usr/local/bin/install-php-extensions \ + && chmod +x /usr/local/bin/install-php-extensions; \ + # Instal/enable all PHP extensions via mlocati/docker-php-extension-installer + install-php-extensions \ + # Stock extensions from upstream image bcmath \ bz2 \ calendar\ @@ -180,9 +132,7 @@ RUN set -xe; \ xsl \ zip \ sysvsem \ - ;\ - pecl update-channels; \ - pecl install >/dev/null /dev/null; \ - apt-get clean; rm -rf /var/lib/apt/lists/* - -# MSSQL PHP client -RUN set -xe; \ - # Repo and key for msodbcsql18 (MS ODBC driver), required by pecl/sqlsrv and pecl/pdo_sqlsrv - curl -fsSL https://packages.microsoft.com/config/debian/12/prod.list -o /etc/apt/sources.list.d/mssql.list; \ - curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor -o /usr/share/keyrings/microsoft-prod.gpg; \ - \ - buildDeps=" \ - unixodbc-dev \ - "; \ - apt-get update >/dev/null; \ - # Necessary for msodbcsql18 (MSSQL) - ACCEPT_EULA=Y \ - apt-get -y --no-install-recommends install >/dev/null \ - $buildDeps \ - msodbcsql18 \ - ;\ - pecl update-channels; \ - pecl install >/dev/null /dev/null; \ apt-get clean; rm -rf /var/lib/apt/lists/* # PHP tools (installed globally) @@ -251,8 +163,6 @@ ENV \ JQ_VERSION=1.7.1 \ YQ_VERSION=4.44.3 RUN set -xe; \ - # Docker PHP Extension Installer - curl -sSLf "https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions" -o /usr/local/bin/install-php-extensions; \ # Composer 1.x curl -fsSL "https://github.com/composer/composer/releases/download/${COMPOSER_VERSION}/composer.phar" -o /usr/local/bin/composer1; \ # Composer 2.x @@ -276,7 +186,7 @@ RUN set -xe; \ # Set Default Composer Version ln -s /usr/local/bin/composer${COMPOSER_DEFAULT_VERSION} /usr/local/bin/composer; \ # Make all downloaded binaries executable in one shot - (cd /usr/local/bin && chmod +x install-php-extensions composer1 composer2 drush8 drupal wp platform acli terminus jq yq); + (cd /usr/local/bin && chmod +x composer1 composer2 drush8 drupal wp platform acli terminus jq yq); # Install Python 3 + pip from Debian repos RUN set -xe; \ diff --git a/8.2/Dockerfile b/8.2/Dockerfile index eaf8eedc..71d5cf3b 100644 --- a/8.2/Dockerfile +++ b/8.2/Dockerfile @@ -106,60 +106,12 @@ ENV NOTVISIBLE "in users profile" # PHP RUN set -xe; \ # Note: essential build tools (g++, gcc, make, etc) are included upstream as persistent packages. - buildDeps=" \ - libc-client2007e-dev \ - libfreetype6-dev \ - libgpgme11-dev \ - libicu-dev \ - libjpeg62-turbo-dev \ - libkrb5-dev \ - libldap2-dev \ - libmagickcore-dev \ - libmagickwand-dev \ - libmemcached-dev \ - libmhash-dev \ - libpng-dev \ - libpq-dev \ - libwebp-dev \ - libssh2-1-dev \ - libxpm-dev \ - libxslt1-dev \ - libzip-dev \ - unixodbc-dev \ - "; \ - apt-get update >/dev/null; \ - apt-get -y --no-install-recommends install >/dev/null \ - $buildDeps \ - libc-client2007e \ - libfreetype6 \ - libgpgme11 \ - libicu72 \ - libjpeg62-turbo \ - libldap-2.5-0 \ - libmagickcore-6.q16-6-extra \ - libmagickwand-6.q16-6 \ - libmemcached11 \ - libmemcachedutil2 \ - libmhash2 \ - libpng16-16 \ - libpq5 \ - libssh2-1 \ - libxpm4 \ - libxslt1.1 \ - libzip4 \ - ;\ - docker-php-ext-configure >/dev/null gd \ - --with-freetype \ - --with-jpeg \ - --with-webp \ - --with-xpm; \ - PHP_OPENSSL=yes docker-php-ext-configure >/dev/null imap --with-kerberos --with-imap-ssl; \ - # Using $(uname -m) (returns x86_64 / aarch64) vs ${TARGETARCH} (returns amd64 / arm64) - docker-php-ext-configure >/dev/null ldap --with-libdir=lib/$(uname -m)-linux-gnu/; \ - docker-php-ext-configure >/dev/null pgsql --with-pgsql=/usr/local/pgsql/; \ - docker-php-ext-configure >/dev/null zip; \ - \ - docker-php-ext-install >/dev/null -j$(nproc) \ + # Docker PHP Extension Installer + curl -sSLf "https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions" -o /usr/local/bin/install-php-extensions \ + && chmod +x /usr/local/bin/install-php-extensions; \ + # Instal/enable all PHP extensions via mlocati/docker-php-extension-installer + install-php-extensions \ + # Stock extensions from upstream image bcmath \ bz2 \ calendar\ @@ -181,9 +133,7 @@ RUN set -xe; \ xsl \ zip \ sysvsem \ - ;\ - pecl update-channels; \ - pecl install >/dev/null /dev/null; \ - apt-get clean; rm -rf /var/lib/apt/lists/* - -# MSSQL PHP client -RUN set -xe; \ - # Repo and key for msodbcsql18 (MS ODBC driver), required by pecl/sqlsrv and pecl/pdo_sqlsrv - curl -fsSL https://packages.microsoft.com/config/debian/12/prod.list -o /etc/apt/sources.list.d/mssql.list; \ - curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor -o /usr/share/keyrings/microsoft-prod.gpg; \ - \ - buildDeps=" \ - unixodbc-dev \ - "; \ - apt-get update >/dev/null; \ - # Necessary for msodbcsql18 (MSSQL) - ACCEPT_EULA=Y \ - apt-get -y --no-install-recommends install >/dev/null \ - $buildDeps \ - msodbcsql18 \ - ;\ - pecl update-channels; \ - pecl install >/dev/null /dev/null; \ apt-get clean; rm -rf /var/lib/apt/lists/* # PHP tools (installed globally) @@ -252,8 +164,6 @@ ENV \ JQ_VERSION=1.7.1 \ YQ_VERSION=4.44.3 RUN set -xe; \ - # Docker PHP Extension Installer - curl -sSLf "https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions" -o /usr/local/bin/install-php-extensions; \ # Composer 1.x curl -fsSL "https://github.com/composer/composer/releases/download/${COMPOSER_VERSION}/composer.phar" -o /usr/local/bin/composer1; \ # Composer 2.x @@ -277,7 +187,7 @@ RUN set -xe; \ # Set Default Composer Version ln -s /usr/local/bin/composer${COMPOSER_DEFAULT_VERSION} /usr/local/bin/composer; \ # Make all downloaded binaries executable in one shot - (cd /usr/local/bin && chmod +x install-php-extensions composer1 composer2 drush8 drupal wp platform acli terminus jq yq); + (cd /usr/local/bin && chmod +x composer1 composer2 drush8 drupal wp platform acli terminus jq yq); # Install Python 3 + pip from Debian repos RUN set -xe; \ diff --git a/8.3/Dockerfile b/8.3/Dockerfile index ef74e237..75990aeb 100644 --- a/8.3/Dockerfile +++ b/8.3/Dockerfile @@ -106,60 +106,12 @@ ENV NOTVISIBLE "in users profile" # PHP RUN set -xe; \ # Note: essential build tools (g++, gcc, make, etc) are included upstream as persistent packages. - buildDeps=" \ - libc-client2007e-dev \ - libfreetype6-dev \ - libgpgme11-dev \ - libicu-dev \ - libjpeg62-turbo-dev \ - libkrb5-dev \ - libldap2-dev \ - libmagickcore-dev \ - libmagickwand-dev \ - libmemcached-dev \ - libmhash-dev \ - libpng-dev \ - libpq-dev \ - libwebp-dev \ - libssh2-1-dev \ - libxpm-dev \ - libxslt1-dev \ - libzip-dev \ - unixodbc-dev \ - "; \ - apt-get update >/dev/null; \ - apt-get -y --no-install-recommends install >/dev/null \ - $buildDeps \ - libc-client2007e \ - libfreetype6 \ - libgpgme11 \ - libicu72 \ - libjpeg62-turbo \ - libldap-2.5-0 \ - libmagickcore-6.q16-6-extra \ - libmagickwand-6.q16-6 \ - libmemcached11 \ - libmemcachedutil2 \ - libmhash2 \ - libpng16-16 \ - libpq5 \ - libssh2-1 \ - libxpm4 \ - libxslt1.1 \ - libzip4 \ - ;\ - docker-php-ext-configure >/dev/null gd \ - --with-freetype \ - --with-jpeg \ - --with-webp \ - --with-xpm; \ - PHP_OPENSSL=yes docker-php-ext-configure >/dev/null imap --with-kerberos --with-imap-ssl; \ - # Using $(uname -m) (returns x86_64 / aarch64) vs ${TARGETARCH} (returns amd64 / arm64) - docker-php-ext-configure >/dev/null ldap --with-libdir=lib/$(uname -m)-linux-gnu/; \ - docker-php-ext-configure >/dev/null pgsql --with-pgsql=/usr/local/pgsql/; \ - docker-php-ext-configure >/dev/null zip; \ - \ - docker-php-ext-install >/dev/null -j$(nproc) \ + # Docker PHP Extension Installer + curl -sSLf "https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions" -o /usr/local/bin/install-php-extensions \ + && chmod +x /usr/local/bin/install-php-extensions; \ + # Instal/enable all PHP extensions via mlocati/docker-php-extension-installer + install-php-extensions \ + # Stock extensions from upstream image bcmath \ bz2 \ calendar\ @@ -181,69 +133,23 @@ RUN set -xe; \ xsl \ zip \ sysvsem \ - ;\ - pecl update-channels; \ - pecl install >/dev/null /dev/null; \ - apt-get clean; rm -rf /var/lib/apt/lists/* - # MSSQL PHP client -RUN set -xe; \ - # Repo and key for msodbcsql18 (MS ODBC driver), required by pecl/sqlsrv and pecl/pdo_sqlsrv - curl -fsSL https://packages.microsoft.com/config/debian/12/prod.list -o /etc/apt/sources.list.d/mssql.list; \ - curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor -o /usr/share/keyrings/microsoft-prod.gpg; \ - \ - buildDeps=" \ - unixodbc-dev \ - "; \ - apt-get update >/dev/null; \ - # Necessary for msodbcsql18 (MSSQL) - ACCEPT_EULA=Y \ - apt-get -y --no-install-recommends install >/dev/null \ - $buildDeps \ - msodbcsql18 \ - ;\ - pecl update-channels; \ - pecl install >/dev/null /dev/null; \ apt-get clean; rm -rf /var/lib/apt/lists/* # PHP tools (installed globally) @@ -261,8 +167,6 @@ ENV \ JQ_VERSION=1.7.1 \ YQ_VERSION=4.44.3 RUN set -xe; \ - # Docker PHP Extension Installer - curl -sSLf "https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions" -o /usr/local/bin/install-php-extensions; \ # Composer 1.x curl -fsSL "https://github.com/composer/composer/releases/download/${COMPOSER_VERSION}/composer.phar" -o /usr/local/bin/composer1; \ # Composer 2.x @@ -286,7 +190,7 @@ RUN set -xe; \ # Set Default Composer Version ln -s /usr/local/bin/composer${COMPOSER_DEFAULT_VERSION} /usr/local/bin/composer; \ # Make all downloaded binaries executable in one shot - (cd /usr/local/bin && chmod +x install-php-extensions composer1 composer2 drush8 drupal wp platform acli terminus jq yq); + (cd /usr/local/bin && chmod +x composer1 composer2 drush8 drupal wp platform acli terminus jq yq); # Install Python 3 + pip from Debian repos RUN set -xe; \ From ac63b60611fbf59737ad8975df9851428b418d15 Mon Sep 17 00:00:00 2001 From: Leonid Makarov Date: Fri, 4 Oct 2024 15:34:54 +0200 Subject: [PATCH 2/6] Updated the list of php modules in tests --- 8.1/tests/php-modules.sh | 6 ++++++ 8.2/tests/php-modules.sh | 6 ++++++ 8.3/tests/php-modules.sh | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/8.1/tests/php-modules.sh b/8.1/tests/php-modules.sh index a74431a5..72bff97e 100755 --- a/8.1/tests/php-modules.sh +++ b/8.1/tests/php-modules.sh @@ -56,6 +56,8 @@ ssh2 standard sysvsem tokenizer +xdebug +xhprof xml xmlreader xmlwriter @@ -65,6 +67,7 @@ zip zlib [Zend Modules] +Xdebug Zend OPcache ' @@ -124,6 +127,8 @@ ssh2 standard sysvsem tokenizer +xdebug +xhprof xml xmlreader xmlwriter @@ -133,6 +138,7 @@ zip zlib [Zend Modules] +Xdebug Zend OPcache ' diff --git a/8.2/tests/php-modules.sh b/8.2/tests/php-modules.sh index e0a1f3fd..58ac29c1 100755 --- a/8.2/tests/php-modules.sh +++ b/8.2/tests/php-modules.sh @@ -57,6 +57,8 @@ ssh2 standard sysvsem tokenizer +xdebug +xhprof xml xmlreader xmlwriter @@ -66,6 +68,7 @@ zip zlib [Zend Modules] +Xdebug Zend OPcache ' @@ -126,6 +129,8 @@ ssh2 standard sysvsem tokenizer +xdebug +xhprof xml xmlreader xmlwriter @@ -135,6 +140,7 @@ zip zlib [Zend Modules] +Xdebug Zend OPcache ' diff --git a/8.3/tests/php-modules.sh b/8.3/tests/php-modules.sh index e0a1f3fd..58ac29c1 100755 --- a/8.3/tests/php-modules.sh +++ b/8.3/tests/php-modules.sh @@ -57,6 +57,8 @@ ssh2 standard sysvsem tokenizer +xdebug +xhprof xml xmlreader xmlwriter @@ -66,6 +68,7 @@ zip zlib [Zend Modules] +Xdebug Zend OPcache ' @@ -126,6 +129,8 @@ ssh2 standard sysvsem tokenizer +xdebug +xhprof xml xmlreader xmlwriter @@ -135,6 +140,7 @@ zip zlib [Zend Modules] +Xdebug Zend OPcache ' From d7c6e8dafe695fb797a36c1833ce203908238814 Mon Sep 17 00:00:00 2001 From: Leonid Makarov Date: Fri, 4 Oct 2024 15:35:12 +0200 Subject: [PATCH 3/6] Typo fix in tests --- tests/test.bats | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test.bats b/tests/test.bats index 3aaf5670..f2cd5ea0 100755 --- a/tests/test.bats +++ b/tests/test.bats @@ -49,7 +49,7 @@ _healthcheck_wait () # Give the container 30s to become ready elapsed=$((elapsed + delay)) if ((elapsed > timeout)); then - echo "$container_name heathcheck failed" + echo "$container_name healthcheck failed" exit 1 fi done From ce97dcda2a203c681c869180128806822db78ed5 Mon Sep 17 00:00:00 2001 From: Leonid Makarov Date: Fri, 4 Oct 2024 15:36:50 +0200 Subject: [PATCH 4/6] Fix PHP module test on Mac See https://bats-core.readthedocs.io/en/stable/gotchas.html --- tests/test.bats | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test.bats b/tests/test.bats index f2cd5ea0..dc5b03a2 100755 --- a/tests/test.bats +++ b/tests/test.bats @@ -135,8 +135,8 @@ _healthcheck_wait () unset output # Check PHP modules - run bash -lc "docker exec -u docker '${NAME}' php -m | diff <(./tests/php-modules.sh) -" - [[ ${status} == 0 ]] + output=$(docker exec -u docker "$NAME" php -m | diff <(./tests/php-modules.sh) -) + [[ ${output} == "" ]] unset output ### Cleanup ### From 84c6cf82f1c25fa6789c1a6c922928b263918626 Mon Sep 17 00:00:00 2001 From: Leonid Makarov Date: Fri, 4 Oct 2024 16:07:04 +0200 Subject: [PATCH 5/6] Revert "Updated the list of php modules in tests" This reverts commit ac63b60611fbf59737ad8975df9851428b418d15. --- 8.1/tests/php-modules.sh | 6 ------ 8.2/tests/php-modules.sh | 6 ------ 8.3/tests/php-modules.sh | 6 ------ 3 files changed, 18 deletions(-) diff --git a/8.1/tests/php-modules.sh b/8.1/tests/php-modules.sh index 72bff97e..a74431a5 100755 --- a/8.1/tests/php-modules.sh +++ b/8.1/tests/php-modules.sh @@ -56,8 +56,6 @@ ssh2 standard sysvsem tokenizer -xdebug -xhprof xml xmlreader xmlwriter @@ -67,7 +65,6 @@ zip zlib [Zend Modules] -Xdebug Zend OPcache ' @@ -127,8 +124,6 @@ ssh2 standard sysvsem tokenizer -xdebug -xhprof xml xmlreader xmlwriter @@ -138,7 +133,6 @@ zip zlib [Zend Modules] -Xdebug Zend OPcache ' diff --git a/8.2/tests/php-modules.sh b/8.2/tests/php-modules.sh index 58ac29c1..e0a1f3fd 100755 --- a/8.2/tests/php-modules.sh +++ b/8.2/tests/php-modules.sh @@ -57,8 +57,6 @@ ssh2 standard sysvsem tokenizer -xdebug -xhprof xml xmlreader xmlwriter @@ -68,7 +66,6 @@ zip zlib [Zend Modules] -Xdebug Zend OPcache ' @@ -129,8 +126,6 @@ ssh2 standard sysvsem tokenizer -xdebug -xhprof xml xmlreader xmlwriter @@ -140,7 +135,6 @@ zip zlib [Zend Modules] -Xdebug Zend OPcache ' diff --git a/8.3/tests/php-modules.sh b/8.3/tests/php-modules.sh index 58ac29c1..e0a1f3fd 100755 --- a/8.3/tests/php-modules.sh +++ b/8.3/tests/php-modules.sh @@ -57,8 +57,6 @@ ssh2 standard sysvsem tokenizer -xdebug -xhprof xml xmlreader xmlwriter @@ -68,7 +66,6 @@ zip zlib [Zend Modules] -Xdebug Zend OPcache ' @@ -129,8 +126,6 @@ ssh2 standard sysvsem tokenizer -xdebug -xhprof xml xmlreader xmlwriter @@ -140,7 +135,6 @@ zip zlib [Zend Modules] -Xdebug Zend OPcache ' From 3cdba8bb8783167b7fe69b69c4ce6d9368b0435b Mon Sep 17 00:00:00 2001 From: Leonid Makarov Date: Fri, 4 Oct 2024 16:46:55 +0200 Subject: [PATCH 6/6] Disable xdebug and xhprof by default to avoid performance impact --- 8.1/Dockerfile | 7 +++++-- 8.2/Dockerfile | 7 +++++-- 8.3/Dockerfile | 9 ++++++--- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/8.1/Dockerfile b/8.1/Dockerfile index 58db4e46..dc5331af 100644 --- a/8.1/Dockerfile +++ b/8.1/Dockerfile @@ -145,8 +145,11 @@ RUN set -xe; \ pdo_sqlsrv \ sqlsrv \ ;\ - # Cleanup - apt-get clean; rm -rf /var/lib/apt/lists/* + # Disable xdebug and xhprof by default to avoid performance impact + # They can be enabled via environment variables at runtime (XDEBUG_ENABLED=1 and XHPROF_ENABLED=1) + # There is no native "docker-php-ext-disable", so we remove the ini files manually + rm -f "$PHP_INI_DIR/conf.d/docker-php-ext-xdebug.ini"; \ + rm -f "$PHP_INI_DIR/conf.d/docker-php-ext-xhprof.ini" # PHP tools (installed globally) ENV \ diff --git a/8.2/Dockerfile b/8.2/Dockerfile index 71d5cf3b..954e9cdb 100644 --- a/8.2/Dockerfile +++ b/8.2/Dockerfile @@ -146,8 +146,11 @@ RUN set -xe; \ pdo_sqlsrv \ sqlsrv \ ;\ - # Cleanup - apt-get clean; rm -rf /var/lib/apt/lists/* + # Disable xdebug and xhprof by default to avoid performance impact + # They can be enabled via environment variables at runtime (XDEBUG_ENABLED=1 and XHPROF_ENABLED=1) + # There is no native "docker-php-ext-disable", so we remove the ini files manually + rm -f "$PHP_INI_DIR/conf.d/docker-php-ext-xdebug.ini"; \ + rm -f "$PHP_INI_DIR/conf.d/docker-php-ext-xhprof.ini" # PHP tools (installed globally) ENV \ diff --git a/8.3/Dockerfile b/8.3/Dockerfile index 75990aeb..04abb0f5 100644 --- a/8.3/Dockerfile +++ b/8.3/Dockerfile @@ -145,12 +145,15 @@ RUN set -xe; \ ssh2 \ xdebug \ xhprof \ -# MSSQL PHP client + # MSSQL PHP client pdo_sqlsrv \ sqlsrv \ ;\ - # Cleanup - apt-get clean; rm -rf /var/lib/apt/lists/* + # Disable xdebug and xhprof by default to avoid performance impact + # They can be enabled via environment variables at runtime (XDEBUG_ENABLED=1 and XHPROF_ENABLED=1) + # There is no native "docker-php-ext-disable", so we remove the ini files manually + rm -f "$PHP_INI_DIR/conf.d/docker-php-ext-xdebug.ini"; \ + rm -f "$PHP_INI_DIR/conf.d/docker-php-ext-xhprof.ini" # PHP tools (installed globally) ENV \