diff --git a/Dockerfile b/Dockerfile index 11e7bf5..d3e2b87 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,7 +21,9 @@ RUN chmod +x /usr/local/bin/install-php-extensions # PEAR < 1.10.18 can't read pecl.php.net responses anymore. RUN pear upgrade --force https://pear.php.net/get/PEAR-1.10.18.tgz -RUN DEBIAN_FRONTEND=noninteractive apt-get update -q \ +# retry: PECL sometimes replies "No releases available" on CI runners. +RUN retry() { for i in 1 2 3; do "$@" && return; sleep 10; done; return 1; }; \ + DEBIAN_FRONTEND=noninteractive apt-get update -q \ && DEBIAN_FRONTEND=noninteractive apt-get install -qq -y \ curl \ git \ @@ -60,10 +62,10 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update -q \ # other extensions. Installing amqp on its own so that install-php-extensions # purges libssl1.0-dev before libssl-dev is installed for the rest. && if [ "${PHP_VERSION%%.*}" = "7" ]; then \ - install-php-extensions amqp \ - && install-php-extensions $(echo "$PHP_EXTENSIONS" | sed 's/amqp//'); \ + retry install-php-extensions amqp \ + && retry install-php-extensions $(echo "$PHP_EXTENSIONS" | sed 's/amqp//'); \ else \ - install-php-extensions $PHP_EXTENSIONS; \ + retry install-php-extensions $PHP_EXTENSIONS; \ fi \ && if command -v a2enmod; then a2enmod rewrite; fi diff --git a/Dockerfile.alpine b/Dockerfile.alpine index 5fa4e50..fec2854 100644 --- a/Dockerfile.alpine +++ b/Dockerfile.alpine @@ -9,7 +9,9 @@ RUN chmod +x /usr/local/bin/install-php-extensions # PEAR < 1.10.18 can't read pecl.php.net responses anymore. RUN pear upgrade --force https://pear.php.net/get/PEAR-1.10.18.tgz -RUN apk add --no-cache \ +# retry: PECL sometimes replies "No releases available" on CI runners. +RUN retry() { for i in 1 2 3; do "$@" && return; sleep 10; done; return 1; }; \ + apk add --no-cache \ coreutils \ curl \ git \ @@ -43,7 +45,7 @@ RUN apk add --no-cache \ 5.6.*) PHP_EXTENSIONS="$PHP_EXTENSIONS mcrypt mysql";; \ 7.0.*|7.1.*) PHP_EXTENSIONS="$PHP_EXTENSIONS mcrypt";; \ esac \ - && install-php-extensions $PHP_EXTENSIONS \ + && retry install-php-extensions $PHP_EXTENSIONS \ && if command -v a2enmod; then a2enmod rewrite; fi # Install Composer. diff --git a/compat/Dockerfile.5.6 b/compat/Dockerfile.5.6 index b296db7..6338d40 100644 --- a/compat/Dockerfile.5.6 +++ b/compat/Dockerfile.5.6 @@ -214,7 +214,9 @@ RUN chmod +x /usr/local/bin/install-php-extensions # PEAR < 1.10.18 can't read pecl.php.net responses anymore. RUN pear upgrade --force https://pear.php.net/get/PEAR-1.10.18.tgz -RUN DEBIAN_FRONTEND=noninteractive apt-get update -q \ +# retry: PECL sometimes replies "No releases available" on CI runners. +RUN retry() { for i in 1 2 3; do "$@" && return; sleep 10; done; return 1; }; \ + DEBIAN_FRONTEND=noninteractive apt-get update -q \ && DEBIAN_FRONTEND=noninteractive apt-get install -qq -y \ curl \ git \ @@ -246,7 +248,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update -q \ xsl \ zip \ " \ - && install-php-extensions $PHP_EXTENSIONS + && retry install-php-extensions $PHP_EXTENSIONS # Install Composer. ENV PATH=$PATH:/root/composer/vendor/bin \ diff --git a/compat/Dockerfile.5.6-apache b/compat/Dockerfile.5.6-apache index 92eff7b..365fb8f 100644 --- a/compat/Dockerfile.5.6-apache +++ b/compat/Dockerfile.5.6-apache @@ -278,7 +278,9 @@ RUN chmod +x /usr/local/bin/install-php-extensions # PEAR < 1.10.18 can't read pecl.php.net responses anymore. RUN pear upgrade --force https://pear.php.net/get/PEAR-1.10.18.tgz -RUN DEBIAN_FRONTEND=noninteractive apt-get update -q \ +# retry: PECL sometimes replies "No releases available" on CI runners. +RUN retry() { for i in 1 2 3; do "$@" && return; sleep 10; done; return 1; }; \ + DEBIAN_FRONTEND=noninteractive apt-get update -q \ && DEBIAN_FRONTEND=noninteractive apt-get install -qq -y \ curl \ git \ @@ -310,7 +312,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update -q \ xsl \ zip \ " \ - && install-php-extensions $PHP_EXTENSIONS \ + && retry install-php-extensions $PHP_EXTENSIONS \ && if command -v a2enmod; then a2enmod rewrite; fi # Install Composer. diff --git a/compat/Dockerfile.5.6-fpm b/compat/Dockerfile.5.6-fpm index f6e4c84..dec3b1f 100644 --- a/compat/Dockerfile.5.6-fpm +++ b/compat/Dockerfile.5.6-fpm @@ -254,7 +254,9 @@ RUN chmod +x /usr/local/bin/install-php-extensions # PEAR < 1.10.18 can't read pecl.php.net responses anymore. RUN pear upgrade --force https://pear.php.net/get/PEAR-1.10.18.tgz -RUN DEBIAN_FRONTEND=noninteractive apt-get update -q \ +# retry: PECL sometimes replies "No releases available" on CI runners. +RUN retry() { for i in 1 2 3; do "$@" && return; sleep 10; done; return 1; }; \ + DEBIAN_FRONTEND=noninteractive apt-get update -q \ && DEBIAN_FRONTEND=noninteractive apt-get install -qq -y \ curl \ git \ @@ -286,7 +288,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update -q \ xsl \ zip \ " \ - && install-php-extensions $PHP_EXTENSIONS + && retry install-php-extensions $PHP_EXTENSIONS # Install Composer. ENV PATH=$PATH:/root/composer/vendor/bin \ diff --git a/dev/Dockerfile b/dev/Dockerfile index 9e7190e..63ff3f7 100644 --- a/dev/Dockerfile +++ b/dev/Dockerfile @@ -3,4 +3,6 @@ FROM ${BASE_IMAGE} LABEL maintainer="dev@chialab.io" # Install XDebug. -RUN install-php-extensions xdebug +# retry: PECL sometimes replies "No releases available" on CI runners. +RUN retry() { for i in 1 2 3; do "$@" && return; sleep 10; done; return 1; }; \ + retry install-php-extensions xdebug diff --git a/otel/Dockerfile b/otel/Dockerfile index 4ad18fd..7ec51c9 100644 --- a/otel/Dockerfile +++ b/otel/Dockerfile @@ -2,8 +2,10 @@ ARG BASE_IMAGE=chialab/php:latest FROM ${BASE_IMAGE} LABEL maintainer="dev@chialab.io" -RUN if [ "$(echo "$PHP_VERSION" | cut -d. -f1,2)" = "8.0" ]; then \ - install-php-extensions protobuf opentelemetry-php/ext-opentelemetry@1.1.3; \ +# retry: PECL sometimes replies "No releases available" on CI runners. +RUN retry() { for i in 1 2 3; do "$@" && return; sleep 10; done; return 1; }; \ + if [ "$(echo "$PHP_VERSION" | cut -d. -f1,2)" = "8.0" ]; then \ + retry install-php-extensions protobuf opentelemetry-php/ext-opentelemetry@1.1.3; \ else \ - install-php-extensions protobuf opentelemetry-php/ext-opentelemetry@1.3.1; \ + retry install-php-extensions protobuf opentelemetry-php/ext-opentelemetry@1.3.1; \ fi diff --git a/pcov/Dockerfile b/pcov/Dockerfile index 34c589c..0137510 100644 --- a/pcov/Dockerfile +++ b/pcov/Dockerfile @@ -3,4 +3,6 @@ FROM ${BASE_IMAGE} LABEL maintainer="dev@chialab.io" # Install PCOV. -RUN install-php-extensions pcov +# retry: PECL sometimes replies "No releases available" on CI runners. +RUN retry() { for i in 1 2 3; do "$@" && return; sleep 10; done; return 1; }; \ + retry install-php-extensions pcov diff --git a/xhprof/Dockerfile b/xhprof/Dockerfile index 6f6da20..4e54d32 100644 --- a/xhprof/Dockerfile +++ b/xhprof/Dockerfile @@ -3,4 +3,6 @@ FROM ${BASE_IMAGE} LABEL maintainer="dev@chialab.io" # Install XHProf. -RUN install-php-extensions xhprof +# retry: PECL sometimes replies "No releases available" on CI runners. +RUN retry() { for i in 1 2 3; do "$@" && return; sleep 10; done; return 1; }; \ + retry install-php-extensions xhprof