From 50300f5bb14591866afbd0cad84722e9c2c4d22c Mon Sep 17 00:00:00 2001 From: "Shao Yu-Lung (Allen)" Date: Thu, 7 Oct 2021 23:39:34 +0800 Subject: [PATCH] php-worker mongodb --- php-worker/Dockerfile | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/php-worker/Dockerfile b/php-worker/Dockerfile index 8dabe29..0f6335d 100644 --- a/php-worker/Dockerfile +++ b/php-worker/Dockerfile @@ -141,13 +141,19 @@ RUN if [ ${INSTALL_SOAP} = true ]; then \ # Install MongoDB drivers: ARG INSTALL_MONGO=false RUN if [ ${INSTALL_MONGO} = true ]; then \ - 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; \ + if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \ + pecl install mongo; \ + docker-php-ext-enable mongo; \ + php -m | grep -oiE '^mongo$'; \ + else \ + if [ $(php -r "echo PHP_VERSION_ID - PHP_RELEASE_VERSION;") = "70000" ]; then \ + pecl install mongodb-1.9.2; \ + else \ + pecl install mongodb; \ + fi; \ + docker-php-ext-enable mongodb; \ + php -m | grep -oiE '^mongodb$'; \ + fi; \ fi ###########################################################################