From 1654ffab7d1598334b97410682763f07bee41da6 Mon Sep 17 00:00:00 2001 From: Pavel Savushkin Date: Tue, 23 Mar 2021 04:01:27 +0200 Subject: [PATCH] fix(SWOOLE extension): add SWOOLE extension installed correctly --- php-worker/Dockerfile | 19 ++++++++++--------- workspace/Dockerfile | 8 ++++---- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/php-worker/Dockerfile b/php-worker/Dockerfile index 5f96e627..9c2a60a1 100644 --- a/php-worker/Dockerfile +++ b/php-worker/Dockerfile @@ -337,16 +337,17 @@ ARG INSTALL_SWOOLE=false RUN if [ ${INSTALL_SWOOLE} = true ]; then \ # Install Php Swoole Extension - if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \ - pecl -q install swoole-2.0.10; \ + if [ $(php -r "echo PHP_VERSION_ID - PHP_RELEASE_VERSION;") = "50600" ]; then \ + echo '' | pecl -q install swoole-2.0.10; \ + elif [ $(php -r "echo PHP_VERSION_ID - PHP_RELEASE_VERSION;") = "70000" ]; then \ + echo '' | pecl -q install swoole-4.3.5; \ + elif [ $(php -r "echo PHP_VERSION_ID - PHP_RELEASE_VERSION;") = "70100" ]; then \ + echo '' | pecl -q install swoole-4.5.11; \ else \ - if [ $(php -r "echo PHP_MINOR_VERSION;") = "0" ]; then \ - pecl install swoole-2.2.0; \ - else \ - pecl install swoole; \ - fi \ - fi \ - && docker-php-ext-enable swoole \ + echo '' | pecl -q install swoole; \ + fi; \ + docker-php-ext-enable swoole \ + && php -m | grep -q 'swoole' \ ;fi ########################################################################### diff --git a/workspace/Dockerfile b/workspace/Dockerfile index e59c449f..97270783 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -551,13 +551,13 @@ RUN set -eux; \ if [ ${INSTALL_SWOOLE} = true ]; then \ # Install Php Swoole Extension if [ $(php -r "echo PHP_VERSION_ID - PHP_RELEASE_VERSION;") = "50600" ]; then \ - pecl install swoole-2.0.10; \ + echo '' | pecl -q install swoole-2.0.10; \ elif [ $(php -r "echo PHP_VERSION_ID - PHP_RELEASE_VERSION;") = "70000" ]; then \ - pecl install swoole-4.3.5; \ + echo '' | pecl -q install swoole-4.3.5; \ elif [ $(php -r "echo PHP_VERSION_ID - PHP_RELEASE_VERSION;") = "70100" ]; then \ - pecl install swoole-4.5.11; \ + echo '' | pecl -q install swoole-4.5.11; \ else \ - pecl install swoole; \ + echo '' | pecl -q install swoole; \ fi; \ echo "extension=swoole.so" >> /etc/php/${LARADOCK_PHP_VERSION}/mods-available/swoole.ini; \ ln -s /etc/php/${LARADOCK_PHP_VERSION}/mods-available/swoole.ini /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/20-swoole.ini; \