Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion 8/8.2/Dockerfile.apache.dev
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions 8/8.3/Dockerfile.apache
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,20 @@ 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.
#
# 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).
#
Expand Down
6 changes: 5 additions & 1 deletion 8/8.3/Dockerfile.apache.dev
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions 8/8.3/Dockerfile.cli
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,20 @@ 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.
#
# 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).
#
Expand Down
6 changes: 5 additions & 1 deletion 8/8.4/Dockerfile.apache
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion 8/8.4/Dockerfile.apache.dev
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion 8/8.4/Dockerfile.cli
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 7 additions & 3 deletions 8/8.5/Dockerfile.apache
Original file line number Diff line number Diff line change
Expand Up @@ -62,21 +62,25 @@ 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.
#
# 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).
#
Expand Down
6 changes: 5 additions & 1 deletion 8/8.5/Dockerfile.apache.dev
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 7 additions & 3 deletions 8/8.5/Dockerfile.cli
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,25 @@ 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.
#
# 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).
#
Expand Down
40 changes: 40 additions & 0 deletions bin/pecl-install
Original file line number Diff line number Diff line change
@@ -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
10 changes: 7 additions & 3 deletions fpm/8.3/Dockerfile.apache
Original file line number Diff line number Diff line change
Expand Up @@ -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).
#
Expand Down
6 changes: 5 additions & 1 deletion fpm/8.3/Dockerfile.apache.dev
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 7 additions & 3 deletions fpm/8.3/Dockerfile.cli
Original file line number Diff line number Diff line change
Expand Up @@ -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).
#
Expand Down
6 changes: 5 additions & 1 deletion fpm/8.3/Dockerfile.cli.dev
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 8 additions & 4 deletions fpm/8.5/Dockerfile.apache
Original file line number Diff line number Diff line change
Expand Up @@ -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).
#
Expand Down
6 changes: 5 additions & 1 deletion fpm/8.5/Dockerfile.apache.dev
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 8 additions & 4 deletions fpm/8.5/Dockerfile.cli
Original file line number Diff line number Diff line change
Expand Up @@ -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).
#
Expand Down
Loading