From 78e0d4d54c6857a6a93750038e1267495001f344 Mon Sep 17 00:00:00 2001 From: "Shao Yu-Lung (Allen)" Date: Sun, 25 Apr 2021 23:48:10 +0800 Subject: [PATCH 1/2] fix amqp build faild #2959 --- php-fpm/Dockerfile | 39 +++++++++++++-------------------------- 1 file changed, 13 insertions(+), 26 deletions(-) diff --git a/php-fpm/Dockerfile b/php-fpm/Dockerfile index 65f8bfd..fc0526e 100644 --- a/php-fpm/Dockerfile +++ b/php-fpm/Dockerfile @@ -410,32 +410,19 @@ RUN set -eux; \ ARG INSTALL_AMQP=false -RUN if [ ${INSTALL_AMQP} = true ]; then \ - # download and install manually, to make sure it's compatible with ampq installed by pecl later - # install cmake first - apt-get -yqq install cmake && \ - if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ] || [ $(php -r "echo PHP_VERSION_ID - PHP_RELEASE_VERSION;") = "70000" ]; then \ - curl -L -o /tmp/rabbitmq-c.tar.gz https://github.com/alanxz/rabbitmq-c/archive/v0.11.0.tar.gz; \ - else \ - curl -L -o /tmp/rabbitmq-c.tar.gz https://github.com/alanxz/rabbitmq-c/archive/master.tar.gz; \ - fi && \ - mkdir -p rabbitmq-c && \ - tar -C rabbitmq-c -zxvf /tmp/rabbitmq-c.tar.gz --strip 1 && \ - cd rabbitmq-c/ && \ - mkdir _build && cd _build/ && \ - cmake .. && \ - cmake --build . --target install && \ - # Install the amqp extension - if [ $(php -r "echo PHP_MAJOR_VERSION;") = "8" ]; then \ - printf "\n" | pecl install amqp-1.11.0beta; \ - else \ - printf "\n" | pecl install amqp; \ - fi && \ - docker-php-ext-enable amqp && \ - # Install the sockets extension - docker-php-ext-install sockets && \ - php -m | grep -q 'sockets' \ -;fi +RUN set -eux; \ + if [ ${INSTALL_AMQP} = true ]; then \ + # # Install the amqp extension + apt-get update; \ + apt-get -yqq install librabbitmq-dev; \ + if [ $(php -r "echo PHP_MAJOR_VERSION;") = "8" ]; then \ + pecl install amqp-1.11.0beta; \ + else \ + pecl install amqp; \ + fi; \ + docker-php-ext-enable amqp; \ + php -m | grep -oiE '^amqp$'; \ + fi ########################################################################### # CASSANDRA: From f49b0cbc3a8e56858f33b09e5d90c71ccdcd990e Mon Sep 17 00:00:00 2001 From: "Shao Yu-Lung (Allen)" Date: Sun, 25 Apr 2021 23:49:07 +0800 Subject: [PATCH 2/2] clean up --- php-fpm/Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/php-fpm/Dockerfile b/php-fpm/Dockerfile index fc0526e..8e76428 100644 --- a/php-fpm/Dockerfile +++ b/php-fpm/Dockerfile @@ -413,7 +413,6 @@ ARG INSTALL_AMQP=false RUN set -eux; \ if [ ${INSTALL_AMQP} = true ]; then \ # # Install the amqp extension - apt-get update; \ apt-get -yqq install librabbitmq-dev; \ if [ $(php -r "echo PHP_MAJOR_VERSION;") = "8" ]; then \ pecl install amqp-1.11.0beta; \