mirror of
https://github.com/jkaninda/laravel-php-fpm.git
synced 2026-11-13 16:47:15 +00:00
Make PECL installs fail-fast with retries; harden integration test
This commit is contained in:
1 parent
1b1be8f55a
commit
857101583b
3 files changed
+19
-4
No files matched your search
@@ -65,7 +65,14 @@ RUN set -eux; \
|
||||
libxml2-dev libzip-dev zlib1g-dev; \
|
||||
docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp; \
|
||||
docker-php-ext-install -j"$(nproc)" bcmath exif gd intl mbstring pcntl pdo_mysql pdo_pgsql zip; \
|
||||
pecl install redis memcached rdkafka; \
|
||||
# One extension per call with retries: pecl does not fail when one of several packages fails
|
||||
for ext in redis memcached rdkafka; do \
|
||||
n=0; \
|
||||
until pecl install -f "$ext" && [ -f "$(php-config --extension-dir)/$ext.so" ]; do \
|
||||
n=$((n + 1)); [ "$n" -ge 3 ] && { echo "pecl install $ext failed"; exit 1; }; \
|
||||
sleep 10; \
|
||||
done; \
|
||||
done; \
|
||||
docker-php-ext-enable redis memcached rdkafka; \
|
||||
# OPcache is always compiled in since PHP 8.5
|
||||
if ! php -m | grep -qi '^zend opcache$'; then docker-php-ext-install opcache; fi; \
|
||||
|
||||
@@ -51,7 +51,14 @@ RUN set -eux; \
|
||||
libxml2-dev libzip-dev zlib-dev cyrus-sasl-dev linux-headers; \
|
||||
docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp; \
|
||||
docker-php-ext-install -j"$(nproc)" bcmath exif gd intl mbstring pcntl pdo_mysql pdo_pgsql zip; \
|
||||
pecl install redis memcached rdkafka; \
|
||||
# One extension per call with retries: pecl does not fail when one of several packages fails
|
||||
for ext in redis memcached rdkafka; do \
|
||||
n=0; \
|
||||
until pecl install -f "$ext" && [ -f "$(php-config --extension-dir)/$ext.so" ]; do \
|
||||
n=$((n + 1)); [ "$n" -ge 3 ] && { echo "pecl install $ext failed"; exit 1; }; \
|
||||
sleep 10; \
|
||||
done; \
|
||||
done; \
|
||||
docker-php-ext-enable redis memcached rdkafka; \
|
||||
# OPcache is always compiled in since PHP 8.5
|
||||
if ! php -m | grep -qi '^zend opcache$'; then docker-php-ext-install opcache; fi; \
|
||||
|
||||
Reference in new issue
Block a user