From 6c50719b75b3030c1c696ae00143facd60ddd60b Mon Sep 17 00:00:00 2001 From: "Shao Yu-Lung (Allen)" Date: Sat, 9 Oct 2021 01:18:32 +0800 Subject: [PATCH] fix php5.6 php-worker swoole --- php-worker/Dockerfile | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/php-worker/Dockerfile b/php-worker/Dockerfile index 0f6335d..d386f23 100644 --- a/php-worker/Dockerfile +++ b/php-worker/Dockerfile @@ -25,6 +25,7 @@ RUN apk --update add wget \ build-base \ libmcrypt-dev \ libxml2-dev \ + linux-headers \ pcre-dev \ zlib-dev \ autoconf \ @@ -350,20 +351,21 @@ RUN if [ ${INSTALL_REDIS} = true ]; then \ ARG INSTALL_SWOOLE=false -RUN if [ ${INSTALL_SWOOLE} = true ]; then \ - # Install Php Swoole Extension - 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 \ - echo '' | pecl -q install swoole; \ - fi; \ - docker-php-ext-enable swoole \ - && php -m | grep -q 'swoole' \ - ;fi +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; \ + elif [ $(php -r "echo PHP_VERSION_ID - PHP_RELEASE_VERSION;") = "70000" ]; then \ + pecl install swoole-4.3.5; \ + elif [ $(php -r "echo PHP_VERSION_ID - PHP_RELEASE_VERSION;") = "70100" ]; then \ + pecl install swoole-4.5.11; \ + else \ + pecl install swoole; \ + fi; \ + docker-php-ext-enable swoole; \ + php -m | grep -oiE '^swoole$'; \ + fi ########################################################################### # Taint EXTENSION