From a3cbfd71f5cd429e313ffbbf040640ee8b26ae15 Mon Sep 17 00:00:00 2001 From: bestlong Date: Mon, 18 Jun 2018 21:27:23 +0800 Subject: [PATCH] Fix php7.0 swoole build failed. --- php-fpm/Dockerfile | 6 +++++- workspace/Dockerfile | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/php-fpm/Dockerfile b/php-fpm/Dockerfile index 3187c3d2..82c82c51 100644 --- a/php-fpm/Dockerfile +++ b/php-fpm/Dockerfile @@ -139,7 +139,11 @@ RUN if [ ${INSTALL_SWOOLE} = true ]; then \ if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \ pecl install swoole-2.0.11; \ else \ - pecl install swoole; \ + 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 \ ;fi diff --git a/workspace/Dockerfile b/workspace/Dockerfile index c13331f2..aa92a940 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -330,7 +330,11 @@ RUN if [ ${INSTALL_SWOOLE} = true ]; then \ if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \ pecl -q install swoole-2.0.11; \ else \ - pecl -q install swoole; \ + if [ $(php -r "echo PHP_MINOR_VERSION;") = "0" ]; then \ + pecl install swoole-2.2.0; \ + else \ + pecl install swoole; \ + fi \ fi && \ echo "extension=swoole.so" >> /etc/php/${PHP_VERSION}/mods-available/swoole.ini && \ ln -s /etc/php/${PHP_VERSION}/mods-available/swoole.ini /etc/php/${PHP_VERSION}/cli/conf.d/20-swoole.ini \