From 1793e7a063d6ea62352873e63e27e1d3c89ab9df Mon Sep 17 00:00:00 2001 From: IanM Date: Wed, 21 Oct 2026 15:10:49 +0100 Subject: [PATCH] fix: retry pecl installs with backoff pecl.php.net answers package downloads with 500/504s, or claims a package has no releases, whenever it is under load. With a PHP security release out and everyone rebuilding at once, that failed whole build matrices on the first error: #20's post-merge builds, and the first attempt of #22's. bin/pecl-install runs `pecl install` up to six times, waiting 10s and doubling each time (about five minutes in all), and clears pear's download cache between attempts. Every `pecl install` in the 8.2-8.5 and FPM images, dev variants included, now goes through it. The dev images copy the script themselves rather than rely on the base image already carrying it. --- 8/8.2/Dockerfile.apache.dev | 6 +++++- 8/8.3/Dockerfile.apache | 8 +++++-- 8/8.3/Dockerfile.apache.dev | 6 +++++- 8/8.3/Dockerfile.cli | 8 +++++-- 8/8.4/Dockerfile.apache | 6 +++++- 8/8.4/Dockerfile.apache.dev | 6 +++++- 8/8.4/Dockerfile.cli | 6 +++++- 8/8.5/Dockerfile.apache | 10 ++++++--- 8/8.5/Dockerfile.apache.dev | 6 +++++- 8/8.5/Dockerfile.cli | 10 ++++++--- bin/pecl-install | 40 +++++++++++++++++++++++++++++++++++ fpm/8.3/Dockerfile.apache | 10 ++++++--- fpm/8.3/Dockerfile.apache.dev | 6 +++++- fpm/8.3/Dockerfile.cli | 10 ++++++--- fpm/8.3/Dockerfile.cli.dev | 6 +++++- fpm/8.5/Dockerfile.apache | 12 +++++++---- fpm/8.5/Dockerfile.apache.dev | 6 +++++- fpm/8.5/Dockerfile.cli | 12 +++++++---- fpm/8.5/Dockerfile.cli.dev | 6 +++++- 19 files changed, 146 insertions(+), 34 deletions(-) create mode 100755 bin/pecl-install diff --git a/8/8.2/Dockerfile.apache.dev b/8/8.2/Dockerfile.apache.dev index fb814eb..2c6f1e0 100755 --- a/8/8.2/Dockerfile.apache.dev +++ b/8/8.2/Dockerfile.apache.dev @@ -6,8 +6,12 @@ FROM ianmgg/php82:latest ENV PROVISION_CONTEXT="development" ENV DEBIAN_FRONTEND=noninteractive +# pecl.php.net fails under load; pecl-install retries with backoff. +COPY bin/pecl-install /usr/local/bin/pecl-install +RUN chmod +x /usr/local/bin/pecl-install + # Install xdebug, enable it, and configure the log -RUN pecl install xdebug-3.4.7 && \ +RUN pecl-install xdebug-3.4.7 && \ docker-php-ext-enable xdebug && \ touch /var/log/xdebug.log && \ chmod 777 /var/log/xdebug.log diff --git a/8/8.3/Dockerfile.apache b/8/8.3/Dockerfile.apache index 4ef8d42..aeeda0e 100644 --- a/8/8.3/Dockerfile.apache +++ b/8/8.3/Dockerfile.apache @@ -62,8 +62,12 @@ RUN docker-php-ext-install pcntl RUN docker-php-ext-install sockets RUN printf "log_errors = On \nerror_log = /dev/stderr\n" > /usr/local/etc/php/conf.d/php-logs.ini +# pecl.php.net fails under load; pecl-install retries with backoff. +COPY bin/pecl-install /usr/local/bin/pecl-install +RUN chmod +x /usr/local/bin/pecl-install + # Install redis extension with LZ4 and Zstd compression support -RUN pecl install --configureoptions 'enable-redis-lz4="yes" with-liblz4="yes" enable-redis-zstd="yes"' redis \ +RUN pecl-install --configureoptions 'enable-redis-lz4="yes" with-liblz4="yes" enable-redis-zstd="yes"' redis \ && docker-php-ext-enable redis # Install maxminddb extension for offline IP -> country lookups. @@ -71,7 +75,7 @@ RUN pecl install --configureoptions 'enable-redis-lz4="yes" with-liblz4="yes" en # The C decoder is roughly 100x faster than maxmind-db/reader's pure-PHP # fallback (~1.7us vs ~160us per lookup), which matters when a lookup happens # on every request. Requires libmaxminddb0 at runtime -- do not purge it. -RUN pecl install maxminddb && docker-php-ext-enable maxminddb +RUN pecl-install maxminddb && docker-php-ext-enable maxminddb # GeoIP databases (DB-IP Country, City and ASN Lite, CC BY 4.0). # diff --git a/8/8.3/Dockerfile.apache.dev b/8/8.3/Dockerfile.apache.dev index 76d3612..dd62893 100755 --- a/8/8.3/Dockerfile.apache.dev +++ b/8/8.3/Dockerfile.apache.dev @@ -6,8 +6,12 @@ FROM ianmgg/php83:latest ENV PROVISION_CONTEXT="development" ENV DEBIAN_FRONTEND=noninteractive +# pecl.php.net fails under load; pecl-install retries with backoff. +COPY bin/pecl-install /usr/local/bin/pecl-install +RUN chmod +x /usr/local/bin/pecl-install + # Install xdebug, enable it, and configure the log -RUN pecl install xdebug-3.4.7 && \ +RUN pecl-install xdebug-3.4.7 && \ docker-php-ext-enable xdebug && \ touch /var/log/xdebug.log && \ chmod 777 /var/log/xdebug.log diff --git a/8/8.3/Dockerfile.cli b/8/8.3/Dockerfile.cli index 9b48877..efcf2ba 100755 --- a/8/8.3/Dockerfile.cli +++ b/8/8.3/Dockerfile.cli @@ -63,8 +63,12 @@ RUN docker-php-ext-install pcntl RUN docker-php-ext-install sockets RUN printf "log_errors = On \nerror_log = /dev/stderr\n" > /usr/local/etc/php/conf.d/php-logs.ini +# pecl.php.net fails under load; pecl-install retries with backoff. +COPY bin/pecl-install /usr/local/bin/pecl-install +RUN chmod +x /usr/local/bin/pecl-install + # Install redis extension with LZ4 and Zstd compression support -RUN pecl install --configureoptions 'enable-redis-lz4="yes" with-liblz4="yes" enable-redis-zstd="yes"' redis \ +RUN pecl-install --configureoptions 'enable-redis-lz4="yes" with-liblz4="yes" enable-redis-zstd="yes"' redis \ && docker-php-ext-enable redis # Install maxminddb extension for offline IP -> country lookups. @@ -72,7 +76,7 @@ RUN pecl install --configureoptions 'enable-redis-lz4="yes" with-liblz4="yes" en # The C decoder is roughly 100x faster than maxmind-db/reader's pure-PHP # fallback (~1.7us vs ~160us per lookup), which matters when a lookup happens # on every request. Requires libmaxminddb0 at runtime -- do not purge it. -RUN pecl install maxminddb && docker-php-ext-enable maxminddb +RUN pecl-install maxminddb && docker-php-ext-enable maxminddb # GeoIP databases (DB-IP Country, City and ASN Lite, CC BY 4.0). # diff --git a/8/8.4/Dockerfile.apache b/8/8.4/Dockerfile.apache index 27d6be2..7894220 100644 --- a/8/8.4/Dockerfile.apache +++ b/8/8.4/Dockerfile.apache @@ -60,8 +60,12 @@ RUN docker-php-ext-install pcntl RUN docker-php-ext-install sockets RUN printf "log_errors = On \nerror_log = /dev/stderr\n" > /usr/local/etc/php/conf.d/php-logs.ini +# pecl.php.net fails under load; pecl-install retries with backoff. +COPY bin/pecl-install /usr/local/bin/pecl-install +RUN chmod +x /usr/local/bin/pecl-install + # Install redis extension with LZ4 and Zstd compression support -RUN pecl install --configureoptions 'enable-redis-lz4="yes" with-liblz4="yes" enable-redis-zstd="yes"' redis \ +RUN pecl-install --configureoptions 'enable-redis-lz4="yes" with-liblz4="yes" enable-redis-zstd="yes"' redis \ && docker-php-ext-enable redis # Apache settings diff --git a/8/8.4/Dockerfile.apache.dev b/8/8.4/Dockerfile.apache.dev index 2d67a19..14dab48 100755 --- a/8/8.4/Dockerfile.apache.dev +++ b/8/8.4/Dockerfile.apache.dev @@ -6,8 +6,12 @@ FROM ianmgg/php84:latest ENV PROVISION_CONTEXT="development" ENV DEBIAN_FRONTEND=noninteractive +# pecl.php.net fails under load; pecl-install retries with backoff. +COPY bin/pecl-install /usr/local/bin/pecl-install +RUN chmod +x /usr/local/bin/pecl-install + # Install xdebug, enable it, and configure the log -RUN pecl install xdebug-3.4.7 && \ +RUN pecl-install xdebug-3.4.7 && \ docker-php-ext-enable xdebug && \ touch /var/log/xdebug.log && \ chmod 777 /var/log/xdebug.log diff --git a/8/8.4/Dockerfile.cli b/8/8.4/Dockerfile.cli index 586c255..819b85e 100755 --- a/8/8.4/Dockerfile.cli +++ b/8/8.4/Dockerfile.cli @@ -61,8 +61,12 @@ RUN docker-php-ext-install pcntl RUN docker-php-ext-install sockets RUN printf "log_errors = On \nerror_log = /dev/stderr\n" > /usr/local/etc/php/conf.d/php-logs.ini +# pecl.php.net fails under load; pecl-install retries with backoff. +COPY bin/pecl-install /usr/local/bin/pecl-install +RUN chmod +x /usr/local/bin/pecl-install + # Install redis extension with LZ4 and Zstd compression support -RUN pecl install --configureoptions 'enable-redis-lz4="yes" with-liblz4="yes" enable-redis-zstd="yes"' redis \ +RUN pecl-install --configureoptions 'enable-redis-lz4="yes" with-liblz4="yes" enable-redis-zstd="yes"' redis \ && docker-php-ext-enable redis # PHP settings diff --git a/8/8.5/Dockerfile.apache b/8/8.5/Dockerfile.apache index eee4b27..514e699 100644 --- a/8/8.5/Dockerfile.apache +++ b/8/8.5/Dockerfile.apache @@ -62,8 +62,12 @@ RUN docker-php-ext-install pcntl RUN docker-php-ext-install sockets RUN printf "log_errors = On \nerror_log = /dev/stderr\n" > /usr/local/etc/php/conf.d/php-logs.ini +# pecl.php.net fails under load; pecl-install retries with backoff. +COPY bin/pecl-install /usr/local/bin/pecl-install +RUN chmod +x /usr/local/bin/pecl-install + # Install redis extension with LZ4 and Zstd compression support -RUN pecl install --configureoptions 'enable-redis-lz4="yes" with-liblz4="yes" enable-redis-zstd="yes"' redis \ +RUN pecl-install --configureoptions 'enable-redis-lz4="yes" with-liblz4="yes" enable-redis-zstd="yes"' redis \ && docker-php-ext-enable redis # Install maxminddb extension for offline IP -> country lookups. @@ -71,12 +75,12 @@ RUN pecl install --configureoptions 'enable-redis-lz4="yes" with-liblz4="yes" en # The C decoder is roughly 100x faster than maxmind-db/reader's pure-PHP # fallback (~1.7us vs ~160us per lookup), which matters when a lookup happens # on every request. Requires libmaxminddb0 at runtime -- do not purge it. -RUN pecl install maxminddb && docker-php-ext-enable maxminddb +RUN pecl-install maxminddb && docker-php-ext-enable maxminddb # Install excimer, Wikimedia's low-overhead sampling profiler. Sentry's PHP SDK # uses it for profiling (fof/sentry's profiling sample rate). It costs nothing # until a profiler is started, so loading it on every request is harmless. -RUN pecl install excimer && docker-php-ext-enable excimer +RUN pecl-install excimer && docker-php-ext-enable excimer # GeoIP databases (DB-IP Country, City and ASN Lite, CC BY 4.0). # diff --git a/8/8.5/Dockerfile.apache.dev b/8/8.5/Dockerfile.apache.dev index 4a472fc..b0a37e2 100755 --- a/8/8.5/Dockerfile.apache.dev +++ b/8/8.5/Dockerfile.apache.dev @@ -6,8 +6,12 @@ FROM ianmgg/php85:latest ENV PROVISION_CONTEXT="development" ENV DEBIAN_FRONTEND=noninteractive +# pecl.php.net fails under load; pecl-install retries with backoff. +COPY bin/pecl-install /usr/local/bin/pecl-install +RUN chmod +x /usr/local/bin/pecl-install + # Install xdebug, enable it, and configure the log -RUN pecl install xdebug-3.5.3 && \ +RUN pecl-install xdebug-3.5.3 && \ docker-php-ext-enable xdebug && \ touch /var/log/xdebug.log && \ chmod 777 /var/log/xdebug.log diff --git a/8/8.5/Dockerfile.cli b/8/8.5/Dockerfile.cli index 2780fc3..99617a5 100755 --- a/8/8.5/Dockerfile.cli +++ b/8/8.5/Dockerfile.cli @@ -63,8 +63,12 @@ RUN docker-php-ext-install pcntl RUN docker-php-ext-install sockets RUN printf "log_errors = On \nerror_log = /dev/stderr\n" > /usr/local/etc/php/conf.d/php-logs.ini +# pecl.php.net fails under load; pecl-install retries with backoff. +COPY bin/pecl-install /usr/local/bin/pecl-install +RUN chmod +x /usr/local/bin/pecl-install + # Install redis extension with LZ4 and Zstd compression support -RUN pecl install --configureoptions 'enable-redis-lz4="yes" with-liblz4="yes" enable-redis-zstd="yes"' redis \ +RUN pecl-install --configureoptions 'enable-redis-lz4="yes" with-liblz4="yes" enable-redis-zstd="yes"' redis \ && docker-php-ext-enable redis # Install maxminddb extension for offline IP -> country lookups. @@ -72,12 +76,12 @@ RUN pecl install --configureoptions 'enable-redis-lz4="yes" with-liblz4="yes" en # The C decoder is roughly 100x faster than maxmind-db/reader's pure-PHP # fallback (~1.7us vs ~160us per lookup), which matters when a lookup happens # on every request. Requires libmaxminddb0 at runtime -- do not purge it. -RUN pecl install maxminddb && docker-php-ext-enable maxminddb +RUN pecl-install maxminddb && docker-php-ext-enable maxminddb # Install excimer, Wikimedia's low-overhead sampling profiler. Sentry's PHP SDK # uses it for profiling (fof/sentry's profiling sample rate). It costs nothing # until a profiler is started, so loading it on every request is harmless. -RUN pecl install excimer && docker-php-ext-enable excimer +RUN pecl-install excimer && docker-php-ext-enable excimer # GeoIP databases (DB-IP Country, City and ASN Lite, CC BY 4.0). # diff --git a/bin/pecl-install b/bin/pecl-install new file mode 100755 index 0000000..4a4cad0 --- /dev/null +++ b/bin/pecl-install @@ -0,0 +1,40 @@ +#!/bin/sh +# Runs `pecl install` with retries, for image builds. +# +# pecl.php.net is a single, volunteer-run service. Under load -- for example +# when a PHP security release has everyone rebuilding images at once -- it +# answers package downloads with 500/504s or claims a package has no releases. +# Each of those failed a whole build matrix outright. A short backoff usually +# gets through, so retry before giving up. +# +# Usage: pecl-install [pecl install arguments...] +# e.g. pecl-install --configureoptions 'enable-redis-lz4="yes"' redis +# +# Retries are tunable for testing: PECL_INSTALL_ATTEMPTS (default 6) and +# PECL_INSTALL_DELAY, the first wait in seconds (default 10), which doubles on +# each further attempt. +set -e + +ATTEMPTS="${PECL_INSTALL_ATTEMPTS:-6}" +DELAY="${PECL_INSTALL_DELAY:-10}" + +attempt=1 +while :; do + if pecl install "$@"; then + exit 0 + fi + + if [ "$attempt" -ge "$ATTEMPTS" ]; then + echo "ERROR: pecl install $* failed after ${ATTEMPTS} attempts" >&2 + exit 1 + fi + + echo "pecl install $* failed (attempt ${attempt}/${ATTEMPTS}), retrying in ${DELAY}s" >&2 + sleep "$DELAY" + attempt=$((attempt + 1)) + DELAY=$((DELAY * 2)) + + # A failed attempt can leave a half-downloaded package in pear's cache; + # clear it so the retry fetches a fresh copy. + rm -rf /tmp/pear +done diff --git a/fpm/8.3/Dockerfile.apache b/fpm/8.3/Dockerfile.apache index 203dd2c..7731fdb 100644 --- a/fpm/8.3/Dockerfile.apache +++ b/fpm/8.3/Dockerfile.apache @@ -82,19 +82,23 @@ RUN docker-php-ext-install pcntl RUN docker-php-ext-install sockets RUN printf "log_errors = On \nerror_log = /dev/stderr\n" > /usr/local/etc/php/conf.d/php-logs.ini +# pecl.php.net fails under load; pecl-install retries with backoff. +COPY bin/pecl-install /usr/local/bin/pecl-install +RUN chmod +x /usr/local/bin/pecl-install + # Install redis extension with LZ4 and Zstd compression support -RUN pecl install --configureoptions 'enable-redis-lz4="yes" with-liblz4="yes" enable-redis-zstd="yes"' redis \ +RUN pecl-install --configureoptions 'enable-redis-lz4="yes" with-liblz4="yes" enable-redis-zstd="yes"' redis \ && docker-php-ext-enable redis # Install imagick extension -RUN pecl install imagick && docker-php-ext-enable imagick +RUN pecl-install imagick && docker-php-ext-enable imagick # Install maxminddb extension for offline IP -> country lookups. # # The C decoder is roughly 100x faster than maxmind-db/reader's pure-PHP # fallback (~1.7us vs ~160us per lookup), which matters when a lookup happens # on every request. Requires libmaxminddb0 at runtime -- do not purge it. -RUN pecl install maxminddb && docker-php-ext-enable maxminddb +RUN pecl-install maxminddb && docker-php-ext-enable maxminddb # GeoIP databases (DB-IP Country, City and ASN Lite, CC BY 4.0). # diff --git a/fpm/8.3/Dockerfile.apache.dev b/fpm/8.3/Dockerfile.apache.dev index 377324d..7747ba4 100644 --- a/fpm/8.3/Dockerfile.apache.dev +++ b/fpm/8.3/Dockerfile.apache.dev @@ -6,8 +6,12 @@ FROM ianmgg/php83fpm:latest ENV PROVISION_CONTEXT="development" ENV DEBIAN_FRONTEND=noninteractive +# pecl.php.net fails under load; pecl-install retries with backoff. +COPY bin/pecl-install /usr/local/bin/pecl-install +RUN chmod +x /usr/local/bin/pecl-install + # Install xdebug, enable it, and configure the log -RUN pecl install xdebug-3.4.7 && \ +RUN pecl-install xdebug-3.4.7 && \ docker-php-ext-enable xdebug && \ touch /var/log/xdebug.log && \ chmod 777 /var/log/xdebug.log diff --git a/fpm/8.3/Dockerfile.cli b/fpm/8.3/Dockerfile.cli index c0385d7..8d6c65f 100644 --- a/fpm/8.3/Dockerfile.cli +++ b/fpm/8.3/Dockerfile.cli @@ -81,19 +81,23 @@ RUN docker-php-ext-install pcntl RUN docker-php-ext-install sockets RUN printf "log_errors = On \nerror_log = /dev/stderr\n" > /usr/local/etc/php/conf.d/php-logs.ini +# pecl.php.net fails under load; pecl-install retries with backoff. +COPY bin/pecl-install /usr/local/bin/pecl-install +RUN chmod +x /usr/local/bin/pecl-install + # Install redis extension with LZ4 and Zstd compression support -RUN pecl install --configureoptions 'enable-redis-lz4="yes" with-liblz4="yes" enable-redis-zstd="yes"' redis \ +RUN pecl-install --configureoptions 'enable-redis-lz4="yes" with-liblz4="yes" enable-redis-zstd="yes"' redis \ && docker-php-ext-enable redis # Install imagick extension -RUN pecl install imagick && docker-php-ext-enable imagick +RUN pecl-install imagick && docker-php-ext-enable imagick # Install maxminddb extension for offline IP -> country lookups. # # The C decoder is roughly 100x faster than maxmind-db/reader's pure-PHP # fallback (~1.7us vs ~160us per lookup), which matters when a lookup happens # on every request. Requires libmaxminddb0 at runtime -- do not purge it. -RUN pecl install maxminddb && docker-php-ext-enable maxminddb +RUN pecl-install maxminddb && docker-php-ext-enable maxminddb # GeoIP databases (DB-IP Country, City and ASN Lite, CC BY 4.0). # diff --git a/fpm/8.3/Dockerfile.cli.dev b/fpm/8.3/Dockerfile.cli.dev index 0332a80..f6959ef 100644 --- a/fpm/8.3/Dockerfile.cli.dev +++ b/fpm/8.3/Dockerfile.cli.dev @@ -6,8 +6,12 @@ FROM ianmgg/php83fpm:cli ENV PROVISION_CONTEXT="development" ENV DEBIAN_FRONTEND=noninteractive +# pecl.php.net fails under load; pecl-install retries with backoff. +COPY bin/pecl-install /usr/local/bin/pecl-install +RUN chmod +x /usr/local/bin/pecl-install + # Install xdebug, enable it, and configure the log -RUN pecl install xdebug-3.4.7 && \ +RUN pecl-install xdebug-3.4.7 && \ docker-php-ext-enable xdebug && \ touch /var/log/xdebug.log && \ chmod 777 /var/log/xdebug.log diff --git a/fpm/8.5/Dockerfile.apache b/fpm/8.5/Dockerfile.apache index f5397e4..006eb22 100644 --- a/fpm/8.5/Dockerfile.apache +++ b/fpm/8.5/Dockerfile.apache @@ -82,24 +82,28 @@ RUN docker-php-ext-install pcntl RUN docker-php-ext-install sockets RUN printf "log_errors = On \nerror_log = /dev/stderr\n" > /usr/local/etc/php/conf.d/php-logs.ini +# pecl.php.net fails under load; pecl-install retries with backoff. +COPY bin/pecl-install /usr/local/bin/pecl-install +RUN chmod +x /usr/local/bin/pecl-install + # Install redis extension with LZ4 and Zstd compression support -RUN pecl install --configureoptions 'enable-redis-lz4="yes" with-liblz4="yes" enable-redis-zstd="yes"' redis \ +RUN pecl-install --configureoptions 'enable-redis-lz4="yes" with-liblz4="yes" enable-redis-zstd="yes"' redis \ && docker-php-ext-enable redis # Install imagick extension -RUN pecl install imagick && docker-php-ext-enable imagick +RUN pecl-install imagick && docker-php-ext-enable imagick # Install maxminddb extension for offline IP -> country lookups. # # The C decoder is roughly 100x faster than maxmind-db/reader's pure-PHP # fallback (~1.7us vs ~160us per lookup), which matters when a lookup happens # on every request. Requires libmaxminddb0 at runtime -- do not purge it. -RUN pecl install maxminddb && docker-php-ext-enable maxminddb +RUN pecl-install maxminddb && docker-php-ext-enable maxminddb # Install excimer, Wikimedia's low-overhead sampling profiler. Sentry's PHP SDK # uses it for profiling (fof/sentry's profiling sample rate). It costs nothing # until a profiler is started, so loading it on every request is harmless. -RUN pecl install excimer && docker-php-ext-enable excimer +RUN pecl-install excimer && docker-php-ext-enable excimer # GeoIP databases (DB-IP Country, City and ASN Lite, CC BY 4.0). # diff --git a/fpm/8.5/Dockerfile.apache.dev b/fpm/8.5/Dockerfile.apache.dev index 2fd1316..3227993 100644 --- a/fpm/8.5/Dockerfile.apache.dev +++ b/fpm/8.5/Dockerfile.apache.dev @@ -6,8 +6,12 @@ FROM ianmgg/php85fpm:latest ENV PROVISION_CONTEXT="development" ENV DEBIAN_FRONTEND=noninteractive +# pecl.php.net fails under load; pecl-install retries with backoff. +COPY bin/pecl-install /usr/local/bin/pecl-install +RUN chmod +x /usr/local/bin/pecl-install + # Install xdebug, enable it, and configure the log -RUN pecl install xdebug-3.5.3 && \ +RUN pecl-install xdebug-3.5.3 && \ docker-php-ext-enable xdebug && \ touch /var/log/xdebug.log && \ chmod 777 /var/log/xdebug.log diff --git a/fpm/8.5/Dockerfile.cli b/fpm/8.5/Dockerfile.cli index 2b7f4a2..96722b8 100644 --- a/fpm/8.5/Dockerfile.cli +++ b/fpm/8.5/Dockerfile.cli @@ -81,24 +81,28 @@ RUN docker-php-ext-install pcntl RUN docker-php-ext-install sockets RUN printf "log_errors = On \nerror_log = /dev/stderr\n" > /usr/local/etc/php/conf.d/php-logs.ini +# pecl.php.net fails under load; pecl-install retries with backoff. +COPY bin/pecl-install /usr/local/bin/pecl-install +RUN chmod +x /usr/local/bin/pecl-install + # Install redis extension with LZ4 and Zstd compression support -RUN pecl install --configureoptions 'enable-redis-lz4="yes" with-liblz4="yes" enable-redis-zstd="yes"' redis \ +RUN pecl-install --configureoptions 'enable-redis-lz4="yes" with-liblz4="yes" enable-redis-zstd="yes"' redis \ && docker-php-ext-enable redis # Install imagick extension -RUN pecl install imagick && docker-php-ext-enable imagick +RUN pecl-install imagick && docker-php-ext-enable imagick # Install maxminddb extension for offline IP -> country lookups. # # The C decoder is roughly 100x faster than maxmind-db/reader's pure-PHP # fallback (~1.7us vs ~160us per lookup), which matters when a lookup happens # on every request. Requires libmaxminddb0 at runtime -- do not purge it. -RUN pecl install maxminddb && docker-php-ext-enable maxminddb +RUN pecl-install maxminddb && docker-php-ext-enable maxminddb # Install excimer, Wikimedia's low-overhead sampling profiler. Sentry's PHP SDK # uses it for profiling (fof/sentry's profiling sample rate). It costs nothing # until a profiler is started, so loading it on every request is harmless. -RUN pecl install excimer && docker-php-ext-enable excimer +RUN pecl-install excimer && docker-php-ext-enable excimer # GeoIP databases (DB-IP Country, City and ASN Lite, CC BY 4.0). # diff --git a/fpm/8.5/Dockerfile.cli.dev b/fpm/8.5/Dockerfile.cli.dev index 4e37c8b..89a9323 100644 --- a/fpm/8.5/Dockerfile.cli.dev +++ b/fpm/8.5/Dockerfile.cli.dev @@ -6,8 +6,12 @@ FROM ianmgg/php85fpm:cli ENV PROVISION_CONTEXT="development" ENV DEBIAN_FRONTEND=noninteractive +# pecl.php.net fails under load; pecl-install retries with backoff. +COPY bin/pecl-install /usr/local/bin/pecl-install +RUN chmod +x /usr/local/bin/pecl-install + # Install xdebug, enable it, and configure the log -RUN pecl install xdebug-3.5.3 && \ +RUN pecl-install xdebug-3.5.3 && \ docker-php-ext-enable xdebug && \ touch /var/log/xdebug.log && \ chmod 777 /var/log/xdebug.log