From 2308faa31a0769a2d283e844407934784ab08aa0 Mon Sep 17 00:00:00 2001 From: Sascha Nowak Date: Mon, 24 Nov 2025 13:37:55 +0100 Subject: [PATCH 1/3] feat: add php 8.5 container --- .github/workflows/php.yml | 5 +++++ build-container.sh | 8 ++++++++ php/8.x.Dockerfile | 10 +++++++--- php/Dockerfile | 4 +++- php/config/fpm-8.5/pool.d/.gitkeep | 0 php/config/fpm-8.5/pool.d/access.conf | 3 +++ 6 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 php/config/fpm-8.5/pool.d/.gitkeep create mode 100644 php/config/fpm-8.5/pool.d/access.conf diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index e19b0af0..efb491ff 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -71,6 +71,11 @@ jobs: build-args: | PHP_VERSION=8.4 UBUNTU_VERSION=24.04 + - version: 8.5 + file: 8.x.Dockerfile + build-args: | + PHP_VERSION=8.5 + UBUNTU_VERSION=24.04 steps: - name: Checkout diff --git a/build-container.sh b/build-container.sh index 30655325..c344d3d9 100755 --- a/build-container.sh +++ b/build-container.sh @@ -105,6 +105,14 @@ docker buildx build -t ghcr.io/netlogix/docker/php-cron:8.4 --build-arg PHP_VERS docker buildx build -t ghcr.io/netlogix/docker/php-cron-dev:8.4 --build-arg PHP_VERSION=8.4 --build-arg UBUNTU_VERSION=24.04 -f php/8.x.Dockerfile --target=php-cron-dev php docker buildx build -t ghcr.io/netlogix/docker/php-supervisor:8.4 --build-arg PHP_VERSION=8.4 --build-arg UBUNTU_VERSION=24.04 -f php/8.x.Dockerfile --target=php-supervisor php +docker buildx build -t ghcr.io/netlogix/docker/php-fpm:8.5 --build-arg PHP_VERSION=8.5 --build-arg UBUNTU_VERSION=24.04 -f php/8.x.Dockerfile --target=php-fpm php +docker buildx build -t ghcr.io/netlogix/docker/php-cli:8.5 --build-arg PHP_VERSION=8.5 --build-arg UBUNTU_VERSION=24.04 -f php/8.x.Dockerfile --target=php-cli php +docker buildx build -t ghcr.io/netlogix/docker/php-fpm-dev:8.5 --build-arg PHP_VERSION=8.5 --build-arg UBUNTU_VERSION=24.04 -f php/8.x.Dockerfile --target=php-fpm-dev php +docker buildx build -t ghcr.io/netlogix/docker/php-cli-dev:8.5 --build-arg PHP_VERSION=8.5 --build-arg UBUNTU_VERSION=24.04 -f php/8.x.Dockerfile --target=php-cli-dev php +docker buildx build -t ghcr.io/netlogix/docker/php-cron:8.5 --build-arg PHP_VERSION=8.5 --build-arg UBUNTU_VERSION=24.04 -f php/8.x.Dockerfile --target=php-cron php +docker buildx build -t ghcr.io/netlogix/docker/php-cron-dev:8.5 --build-arg PHP_VERSION=8.5 --build-arg UBUNTU_VERSION=24.04 -f php/8.x.Dockerfile --target=php-cron-dev php +docker buildx build -t ghcr.io/netlogix/docker/php-supervisor:8.5 --build-arg PHP_VERSION=8.5 --build-arg UBUNTU_VERSION=24.04 -f php/8.x.Dockerfile --target=php-supervisor php + docker buildx build -t ghcr.io/netlogix/docker/frankenphp:8.3 --build-arg PHP_VERSION=8.3 -f php/frankenphp.Dockerfile --target=frankenphp php docker buildx build -t ghcr.io/netlogix/docker/frankenphp-dev:8.3 --build-arg PHP_VERSION=8.3 -f php/frankenphp.Dockerfile --target=frankenphp-dev php docker buildx build -t ghcr.io/netlogix/docker/frankenphp-cli:8.3 --build-arg PHP_VERSION=8.3 -f php/frankenphp.Dockerfile --target=frankenphp-cli php diff --git a/php/8.x.Dockerfile b/php/8.x.Dockerfile index 57e2610a..ee5cedd6 100644 --- a/php/8.x.Dockerfile +++ b/php/8.x.Dockerfile @@ -28,7 +28,7 @@ ENV PHP_VERSION=${PHP_VERSION} \ PHP_OPCACHE_PRELOAD_USER=www-data \ PHP_OPCACHE_ENABLE_CLI=0 \ PHP_OPCACHE_VALIDATE_TIMESTAMPS=1 \ - PHP_OPCACHE_FILE_CACHE=null \ + PHP_OPCACHE_FILE_CACHE="/tmp/opcache" \ PHP_OPCACHE_FILE_CACHE_ONLY=0 \ PHP_OPCACHE_REVALIDATE_FREQ=2 \ PHP_REALPATH_CACHE_TTL=120 \ @@ -78,7 +78,6 @@ RUN apt-get update && \ webp \ zip \ php${PHP_VERSION} \ - php${PHP_VERSION}-amqp \ php${PHP_VERSION}-apcu \ php${PHP_VERSION}-bcmath \ php${PHP_VERSION}-cli \ @@ -92,7 +91,6 @@ RUN apt-get update && \ php${PHP_VERSION}-intl \ php${PHP_VERSION}-mbstring \ php${PHP_VERSION}-mysql \ - php${PHP_VERSION}-opcache \ php${PHP_VERSION}-pgsql \ php${PHP_VERSION}-raphf \ php${PHP_VERSION}-readline \ @@ -104,6 +102,10 @@ RUN apt-get update && \ php${PHP_VERSION}-zip \ tideways-php \ tideways-cli \ + # install opcache when php version is not 8.5. Opcache is now part of the php binary \ + && if [ "${PHP_VERSION}" != "8.5" ]; then \ + apt-get -y install --no-install-suggests --no-install-recommends php${PHP_VERSION}-amqp php${PHP_VERSION}-opcache; \ + fi \ && apt-get autoremove \ && find /var/log -type f -name "*.log" -delete \ && rm -rf /var/lib/apt/lists/* /var/cache/ldconfig/aux-cache \ @@ -128,6 +130,8 @@ RUN ln -s /usr/sbin/php-fpm${PHP_VERSION} /usr/sbin/php-fpm RUN mkdir -p "/run/php/" \ && chown -R www-data:www-data /run/php/ \ && chmod 755 /run/php/ \ + && mkdir -p ${PHP_OPCACHE_FILE_CACHE} \ + && chown -R www-data:www-data ${PHP_OPCACHE_FILE_CACHE} \ && touch /var/log/xdebug.log \ && chown www-data:www-data /var/log/xdebug.log diff --git a/php/Dockerfile b/php/Dockerfile index a3a2a2fc..7c3ea720 100644 --- a/php/Dockerfile +++ b/php/Dockerfile @@ -28,7 +28,7 @@ ENV PHP_VERSION=${PHP_VERSION} \ PHP_OPCACHE_PRELOAD_USER=www-data \ PHP_OPCACHE_ENABLE_CLI=0 \ PHP_OPCACHE_VALIDATE_TIMESTAMPS=1 \ - PHP_OPCACHE_FILE_CACHE=null \ + PHP_OPCACHE_FILE_CACHE="/tmp/opcache" \ PHP_OPCACHE_FILE_CACHE_ONLY=0 \ PHP_OPCACHE_REVALIDATE_FREQ=2 \ PHP_REALPATH_CACHE_TTL=120 \ @@ -124,6 +124,8 @@ RUN ln -s /usr/sbin/php-fpm${PHP_VERSION} /usr/sbin/php-fpm RUN mkdir -p "/run/php/" \ && chown -R www-data:www-data /run/php/ \ && chmod 755 /run/php/ \ + && mkdir -p ${PHP_OPCACHE_FILE_CACHE} \ + && chown -R www-data:www-data ${PHP_OPCACHE_FILE_CACHE} \ && touch /var/log/xdebug.log \ && chown www-data:www-data /var/log/xdebug.log diff --git a/php/config/fpm-8.5/pool.d/.gitkeep b/php/config/fpm-8.5/pool.d/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/php/config/fpm-8.5/pool.d/access.conf b/php/config/fpm-8.5/pool.d/access.conf new file mode 100644 index 00000000..dabb62e9 --- /dev/null +++ b/php/config/fpm-8.5/pool.d/access.conf @@ -0,0 +1,3 @@ +[www] +access.suppress_path[] = /health +access.suppress_path[] = /status From e26839b45f7e5ec999fc23036569cb735e49e207 Mon Sep 17 00:00:00 2001 From: Sascha Nowak Date: Thu, 4 Dec 2025 20:33:59 +0100 Subject: [PATCH 2/3] fix: php 7.4 build --- .github/workflows/php.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index efb491ff..846850fb 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -41,7 +41,7 @@ jobs: PHP_VERSION=7.3 UBUNTU_VERSION=24.04 - version: 7.4 - file: Dockerfile + file: 7.x.Dockerfile build-args: | PHP_VERSION=7.4 UBUNTU_VERSION=20.04 From f3aeda1bc89a303ff0dfda20eb182dc2a3d37715 Mon Sep 17 00:00:00 2001 From: Sascha Nowak Date: Thu, 4 Dec 2025 20:41:36 +0100 Subject: [PATCH 3/3] feat: switch to pie to install xdebug 3.5 PECL is now deprecated. PHP Installer for Extensions (PIE) is the replacement for PECL. --- .github/workflows/php.yml | 1 - build-container.sh | 17 +++++++---------- php/8.x.Dockerfile | 22 ++++++++++++---------- php/Dockerfile | 20 ++++++++++---------- 4 files changed, 29 insertions(+), 31 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 846850fb..ae608d5c 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -45,7 +45,6 @@ jobs: build-args: | PHP_VERSION=7.4 UBUNTU_VERSION=20.04 - XDEBUG_VERSION=3.1.6 - version: 8.0 file: 8.x.Dockerfile build-args: | diff --git a/build-container.sh b/build-container.sh index c344d3d9..1e545f7c 100755 --- a/build-container.sh +++ b/build-container.sh @@ -57,20 +57,17 @@ docker buildx build -t ghcr.io/netlogix/docker/php-cron:7.3 --build-arg PHP_VERS docker buildx build -t ghcr.io/netlogix/docker/php-cron-dev:7.3 --build-arg PHP_VERSION=7.3 --build-arg UBUNTU_VERSION=24.04 -f php/7.x.Dockerfile --target=php-cron-dev php docker buildx build -t ghcr.io/netlogix/docker/php-supervisor:7.3 --build-arg PHP_VERSION=7.3 --build-arg UBUNTU_VERSION=24.04 -f php/7.x.Dockerfile --target=php-supervisor php -docker buildx build -t ghcr.io/netlogix/docker/php-fpm:7.4 --build-arg PHP_VERSION=7.4 --build-arg UBUNTU_VERSION=20.04 -f php/Dockerfile --target=php-fpm php -docker buildx build -t ghcr.io/netlogix/docker/php-cli:7.4 --build-arg PHP_VERSION=7.4 --build-arg UBUNTU_VERSION=20.04 -f php/Dockerfile --target=php-cli php -docker buildx build -t ghcr.io/netlogix/docker/php-fpm-dev:7.4 --build-arg PHP_VERSION=7.4 --build-arg UBUNTU_VERSION=20.04 -f php/Dockerfile --target=php-fpm-dev php -docker buildx build -t ghcr.io/netlogix/docker/php-cli-dev:7.4 --build-arg PHP_VERSION=7.4 --build-arg UBUNTU_VERSION=20.04 -f php/Dockerfile --target=php-cli-dev php -docker buildx build -t ghcr.io/netlogix/docker/php-cron:7.4 --build-arg PHP_VERSION=7.4 --build-arg UBUNTU_VERSION=20.04 -f php/Dockerfile --target=php-cron php -docker buildx build -t ghcr.io/netlogix/docker/php-cron-dev:7.4 --build-arg PHP_VERSION=7.4 --build-arg UBUNTU_VERSION=20.04 -f php/Dockerfile --target=php-cron-dev php -docker buildx build -t ghcr.io/netlogix/docker/php-supervisor:7.4 --build-arg PHP_VERSION=7.4 --build-arg UBUNTU_VERSION=20.04 -f php/Dockerfile --target=php-supervisor php +docker buildx build -t ghcr.io/netlogix/docker/php-fpm:7.4 --build-arg PHP_VERSION=7.4 --build-arg UBUNTU_VERSION=20.04 -f php/7.x.Dockerfile --target=php-fpm php +docker buildx build -t ghcr.io/netlogix/docker/php-cli:7.4 --build-arg PHP_VERSION=7.4 --build-arg UBUNTU_VERSION=20.04 -f php/7.x.Dockerfile --target=php-cli php +docker buildx build -t ghcr.io/netlogix/docker/php-fpm-dev:7.4 --build-arg PHP_VERSION=7.4 --build-arg UBUNTU_VERSION=20.04 -f php/7.x.Dockerfile --target=php-fpm-dev php +docker buildx build -t ghcr.io/netlogix/docker/php-cli-dev:7.4 --build-arg PHP_VERSION=7.4 --build-arg UBUNTU_VERSION=20.04 -f php/7.x.Dockerfile --target=php-cli-dev php +docker buildx build -t ghcr.io/netlogix/docker/php-cron:7.4 --build-arg PHP_VERSION=7.4 --build-arg UBUNTU_VERSION=20.04 -f php/7.x.Dockerfile --target=php-cron php +docker buildx build -t ghcr.io/netlogix/docker/php-cron-dev:7.4 --build-arg PHP_VERSION=7.4 --build-arg UBUNTU_VERSION=20.04 -f php/7.x.Dockerfile --target=php-cron-dev php +docker buildx build -t ghcr.io/netlogix/docker/php-supervisor:7.4 --build-arg PHP_VERSION=7.4 --build-arg UBUNTU_VERSION=20.04 -f php/7.x.Dockerfile --target=php-supervisor php docker buildx build -t ghcr.io/netlogix/docker/php-fpm:8.0 --build-arg PHP_VERSION=8.0 --build-arg UBUNTU_VERSION=24.04 -f php/8.x.Dockerfile --target=php-fpm php docker buildx build -t ghcr.io/netlogix/docker/php-cli:8.0 --build-arg PHP_VERSION=8.0 --build-arg UBUNTU_VERSION=24.04 -f php/8.x.Dockerfile --target=php-cli php -docker buildx build -t ghcr.io/netlogix/docker/php-fpm-dev:8.0 --build-arg PHP_VERSION=8.0 --build-arg UBUNTU_VERSION=24.04 -f php/8.x.Dockerfile --target=php-fpm-dev php -docker buildx build -t ghcr.io/netlogix/docker/php-cli-dev:8.0 --build-arg PHP_VERSION=8.0 --build-arg UBUNTU_VERSION=24.04 -f php/8.x.Dockerfile --target=php-cli-dev php docker buildx build -t ghcr.io/netlogix/docker/php-cron:8.0--build-arg PHP_VERSION=8.0 --build-arg UBUNTU_VERSION=24.04 -f php/8.x.Dockerfile --target=php-cron php -docker buildx build -t ghcr.io/netlogix/docker/php-cron-dev:8.0 --build-arg PHP_VERSION=8.0 --build-arg UBUNTU_VERSION=24.04 -f php/8.x.Dockerfile --target=php-cron-dev php docker buildx build -t ghcr.io/netlogix/docker/php-supervisor:8.0 --build-arg PHP_VERSION=8.0 --build-arg UBUNTU_VERSION=24.04 -f php/8.x.Dockerfile --target=php-supervisor php docker buildx build -t ghcr.io/netlogix/docker/php-fpm:8.1 --build-arg PHP_VERSION=8.1 --build-arg UBUNTU_VERSION=22.04 -f php/Dockerfile --target=php-fpm php diff --git a/php/8.x.Dockerfile b/php/8.x.Dockerfile index ee5cedd6..ddc0a528 100644 --- a/php/8.x.Dockerfile +++ b/php/8.x.Dockerfile @@ -3,8 +3,8 @@ ARG UBUNTU_VERSION=24.04 FROM ubuntu:${UBUNTU_VERSION} AS base ARG PHP_VERSION=8.4 -# renovate: datasource=github-releases depName=xdebug packageName=xdebug/xdebug -ARG XDEBUG_VERSION=3.5.0 +# renovate: datasource=github-releases depName=php-pie packageName=php/pie +ARG PHP_PIE_VERSION=1.3.1 ENV DEBIAN_FRONTEND=noninteractive \ TZ="Europe/Berlin" \ @@ -44,7 +44,7 @@ ENV PHP_VERSION=${PHP_VERSION} \ PHP_FPM_PM_MIN_SPARE_SERVERS=2 \ PHP_FPM_PM_MAX_SPARE_SERVERS=4 \ PHP_FPM_PM_MAX_REQUESTS=1000 \ - XDEBUG_VERSION=${XDEBUG_VERSION} \ + PHP_PIE_VERSION=${PHP_PIE_VERSION} \ TIDEWAYS_APIKEY="" \ TIDEWAYS_AUTO_START=1 \ TIDEWAYS_DAEMON="tcp://tideways-daemon:9135" \ @@ -78,6 +78,7 @@ RUN apt-get update && \ webp \ zip \ php${PHP_VERSION} \ + php${PHP_VERSION}-amqp \ php${PHP_VERSION}-apcu \ php${PHP_VERSION}-bcmath \ php${PHP_VERSION}-cli \ @@ -104,7 +105,7 @@ RUN apt-get update && \ tideways-cli \ # install opcache when php version is not 8.5. Opcache is now part of the php binary \ && if [ "${PHP_VERSION}" != "8.5" ]; then \ - apt-get -y install --no-install-suggests --no-install-recommends php${PHP_VERSION}-amqp php${PHP_VERSION}-opcache; \ + apt-get -y install --no-install-suggests --no-install-recommends php${PHP_VERSION}-opcache; \ fi \ && apt-get autoremove \ && find /var/log -type f -name "*.log" -delete \ @@ -210,13 +211,12 @@ ENV PHP_IDE_CONFIG="serverName=localhost" RUN apt-get update && \ apt-get -y install --no-install-suggests --no-install-recommends \ - make php${PHP_VERSION}-dev php-pear openssh-client git patch \ - && mkdir -p /tmp/pear/cache \ - && pecl channel-update pecl.php.net \ - && pecl install xdebug-${XDEBUG_VERSION} \ - && echo "zend_extension=xdebug.so" > /etc/php/${PHP_VERSION}/mods-available/xdebug.ini \ + make php${PHP_VERSION}-dev openssh-client git patch \ + && curl -L -sS https://github.com/php/pie/releases/download/${PHP_PIE_VERSION}/pie.phar -o /usr/local/bin/pie \ + && chmod +x /usr/local/bin/pie \ + && pie install xdebug/xdebug \ && phpenmod xdebug \ - && apt-get -y autoremove --purge make php${PHP_VERSION}-dev php-pear \ + && apt-get -y autoremove --purge make php${PHP_VERSION}-dev \ && apt-get autoremove \ && find /var/log -type f -name "*.log" -delete \ && rm -rf /root/.pearrc \ @@ -227,6 +227,8 @@ RUN apt-get update && \ && rm -rf /usr/share/bug/file \ && rm -rf /usr/share/doc/file \ && rm -rf /var/lib/apt/lists/* /var/cache/ldconfig/aux-cache \ + && rm -rf /root/.config/pie \ + && rm /usr/local/bin/pie \ && touch /var/log/xdebug.log \ && chown www-data:www-data /var/log/xdebug.log diff --git a/php/Dockerfile b/php/Dockerfile index 7c3ea720..d3a61e32 100644 --- a/php/Dockerfile +++ b/php/Dockerfile @@ -2,9 +2,9 @@ # check=skip=SecretsUsedInArgOrEnv ARG UBUNTU_VERSION=24.04 FROM ubuntu:${UBUNTU_VERSION} AS base -ARG PHP_VERSION=8.3 -# renovate: datasource=github-releases depName=xdebug packageName=xdebug/xdebug -ARG XDEBUG_VERSION=3.5.0 +ARG PHP_VERSION=8.4 +# renovate: datasource=github-releases depName=php-pie packageName=php/pie +ARG PHP_PIE_VERSION=1.3.1 ENV DEBIAN_FRONTEND=noninteractive \ TZ="Europe/Berlin" \ @@ -44,7 +44,7 @@ ENV PHP_VERSION=${PHP_VERSION} \ PHP_FPM_PM_MIN_SPARE_SERVERS=2 \ PHP_FPM_PM_MAX_SPARE_SERVERS=4 \ PHP_FPM_PM_MAX_REQUESTS=1000 \ - XDEBUG_VERSION=${XDEBUG_VERSION} \ + PHP_PIE_VERSION=${PHP_PIE_VERSION} \ TIDEWAYS_APIKEY="" \ TIDEWAYS_AUTO_START=1 \ TIDEWAYS_DAEMON="tcp://tideways-daemon:9135" \ @@ -204,13 +204,12 @@ ENV PHP_IDE_CONFIG="serverName=localhost" RUN apt-get update && \ apt-get -y install --no-install-suggests --no-install-recommends \ - make php${PHP_VERSION}-dev php-pear openssh-client git patch \ - && mkdir -p /tmp/pear/cache \ - && pecl channel-update pecl.php.net \ - && pecl install xdebug-${XDEBUG_VERSION} \ - && echo "zend_extension=xdebug.so" > /etc/php/${PHP_VERSION}/mods-available/xdebug.ini \ + make php${PHP_VERSION}-dev openssh-client git patch \ + && curl -L -sS https://github.com/php/pie/releases/download/${PHP_PIE_VERSION}/pie.phar -o /usr/local/bin/pie \ + && chmod +x /usr/local/bin/pie \ + && pie install xdebug/xdebug \ && phpenmod xdebug \ - && apt-get -y autoremove --purge make php${PHP_VERSION}-dev php-pear \ + && apt-get -y autoremove --purge make php${PHP_VERSION}-dev \ && apt-get autoremove \ && find /var/log -type f -name "*.log" -delete \ && rm -rf /root/.pearrc \ @@ -221,6 +220,7 @@ RUN apt-get update && \ && rm -rf /usr/share/bug/file \ && rm -rf /usr/share/doc/file \ && rm -rf /var/lib/apt/lists/* /var/cache/ldconfig/aux-cache \ + && rm /usr/local/bin/pie \ && touch /var/log/xdebug.log \ && chown www-data:www-data /var/log/xdebug.log