From 4d93c69d5d78a725d166145b575b1f6b0d987fd9 Mon Sep 17 00:00:00 2001 From: Shao Yu Lung Date: Sat, 20 Mar 2021 19:39:09 +0800 Subject: [PATCH] php-worker mongo | PHP 5.6 --- php-worker/Dockerfile | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/php-worker/Dockerfile b/php-worker/Dockerfile index db1f693..7a96403 100644 --- a/php-worker/Dockerfile +++ b/php-worker/Dockerfile @@ -111,8 +111,13 @@ RUN if [ ${INSTALL_SOAP} = true ]; then \ # Install MongoDB drivers: ARG INSTALL_MONGO=false RUN if [ ${INSTALL_MONGO} = true ]; then \ - pecl install mongodb; \ - docker-php-ext-enable mongodb; \ + if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \ + pecl install mongo; \ + docker-php-ext-enable mongo; \ + else \ + pecl install mongodb; \ + docker-php-ext-enable mongodb; \ + fi; \ fi #Install BCMath package: @@ -357,6 +362,16 @@ RUN if [ ${INSTALL_XMLRPC} = true ]; then \ docker-php-ext-install xmlrpc \ ;fi +RUN if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \ + pecl install mongo; \ + docker-php-ext-enable mongo; \ + php -m | grep -q 'mongo'; \ + else \ + pecl install mongodb; \ + docker-php-ext-enable mongodb; \ + php -m | grep -q 'mongodb'; \ + fi + # #-------------------------------------------------------------------------- # Optional Supervisord Configuration