From c59197c8fd6285dbb1a6d43ea7186f3cf31ebac9 Mon Sep 17 00:00:00 2001 From: "Shao Yu-Lung (Allen)" Date: Wed, 17 Mar 2021 13:25:12 +0800 Subject: [PATCH 1/2] fix xhprof --- php-fpm/Dockerfile | 53 ++++++++++++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 23 deletions(-) diff --git a/php-fpm/Dockerfile b/php-fpm/Dockerfile index 4f1fdba..33a2541 100644 --- a/php-fpm/Dockerfile +++ b/php-fpm/Dockerfile @@ -339,31 +339,38 @@ RUN if [ ${INSTALL_MONGO} = true ]; then \ ARG INSTALL_XHPROF=false -RUN if [ ${INSTALL_XHPROF} = true ]; then \ - # Install the php xhprof extension - if [ $(php -r "echo PHP_MAJOR_VERSION;") = 7 ]; then \ - curl -L -o /tmp/xhprof.tar.gz "https://github.com/tideways/php-xhprof-extension/archive/v5.0.1.tar.gz"; \ - else \ - curl -L -o /tmp/xhprof.tar.gz "https://codeload.github.com/phacility/xhprof/tar.gz/master"; \ - fi \ - && mkdir -p xhprof \ - && tar -C xhprof -zxvf /tmp/xhprof.tar.gz --strip 1 \ - && ( \ - cd xhprof \ - && phpize \ - && ./configure \ - && make \ - && make install \ - ) \ - && rm -r xhprof \ - && rm /tmp/xhprof.tar.gz \ -;fi +RUN set -eux; \ + if [ ${INSTALL_XHPROF} = true ]; then \ + # Install the php xhprof extension + if [ $(php -r "echo PHP_MAJOR_VERSION;") != 5 ]; then \ + pecl install xhprof; \ + else \ + curl -L -o /tmp/xhprof.tar.gz "https://codeload.github.com/phacility/xhprof/tar.gz/master"; \ + mkdir -p /tmp/xhprof; \ + tar -C /tmp/xhprof -zxvf /tmp/xhprof.tar.gz --strip 1; \ + ( \ + cd /tmp/xhprof/extension; \ + phpize; \ + ./configure; \ + make; \ + make install; \ + ); \ + rm -r /tmp/xhprof; \ + rm /tmp/xhprof.tar.gz; \ + fi; \ + docker-php-ext-enable xhprof; \ + php -m | grep -q 'xhprof'; \ + fi -COPY ./xhprof.ini /usr/local/etc/php/conf.d +# if [ ${INSTALL_XHPROF_USE_TIDYWAYS} = true ]; then \ +# https://github.com/tideways/php-xhprof-extension +# fi -RUN if [ ${INSTALL_XHPROF} = false ]; then \ - rm /usr/local/etc/php/conf.d/xhprof.ini \ -;fi +# COPY ./xhprof.ini /usr/local/etc/php/conf.d + +# RUN if [ ${INSTALL_XHPROF} = false ]; then \ +# rm /usr/local/etc/php/conf.d/xhprof.ini \ +# ;fi ########################################################################### # AMQP: From 2f6e89cc98d162d7b59fe2b45272218d49e61f9e Mon Sep 17 00:00:00 2001 From: "Shao Yu-Lung (Allen)" Date: Wed, 17 Mar 2021 14:39:07 +0800 Subject: [PATCH 2/2] skip install fail extension --- .github/workflows/main-ci.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/main-ci.yml b/.github/workflows/main-ci.yml index ecd31a7..18fbef5 100644 --- a/.github/workflows/main-ci.yml +++ b/.github/workflows/main-ci.yml @@ -25,6 +25,13 @@ jobs: # sed -i -- '201,272s/=false/=true/g' .env sed -i -- 's/CHANGE_SOURCE=true/CHANGE_SOURCE=false/g' .env sed -i -- 's/PHPDBG=true/PHPDBG=false/g' .env + sed -i -- 's/CASSANDRA=true/CASSANDRA=false/g' .env + sed -i -- 's/GEARMAN=true/GEARMAN=false/g' .env + sed -i -- 's/AEROSPIKE=true/AEROSPIKE=false/g' .env + sed -i -- 's/PHALCON=true/PHALCON=false/g' .env + sed -i -- 's/RDKAFKA=true/RDKAFKA=false/g' .env + sed -i -- 's/MAILPARSE=true/MAILPARSE=false/g' .env + sed -i -- 's/YAML=true/YAML=false/g' .env docker-compose build ${{ matrix.service }} build-other: