From b26bcdb42a403d060ad366d90d8218f3af28e34c Mon Sep 17 00:00:00 2001 From: Shao Yu Lung Date: Wed, 5 Feb 2020 14:54:57 +0800 Subject: [PATCH] php 7.4 php-worker zip ext. --- docker-compose.yml | 2 +- php-worker/Dockerfile | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 0fa1a0d4..e352a29d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -248,7 +248,7 @@ services: context: ./php-worker args: - CHANGE_SOURCE=${CHANGE_SOURCE} - - PHP_VERSION=${PHP_VERSION} + - LARADOCK_PHP_VERSION=${PHP_VERSION} - PHALCON_VERSION=${PHALCON_VERSION} - INSTALL_PGSQL=${PHP_WORKER_INSTALL_PGSQL} - INSTALL_BCMATH=${PHP_WORKER_INSTALL_BCMATH} diff --git a/php-worker/Dockerfile b/php-worker/Dockerfile index d9733e5f..388940ef 100644 --- a/php-worker/Dockerfile +++ b/php-worker/Dockerfile @@ -4,11 +4,13 @@ #-------------------------------------------------------------------------- # -ARG PHP_VERSION=${PHP_VERSION} -FROM php:${PHP_VERSION}-alpine +ARG LARADOCK_PHP_VERSION +FROM php:${LARADOCK_PHP_VERSION}-alpine LABEL maintainer="Mahmoud Zalt " +ARG LARADOCK_PHP_VERSION + # If you're in China, or you need to change sources, will be set CHANGE_SOURCE to true in .env. ARG CHANGE_SOURCE=false @@ -65,9 +67,14 @@ RUN if [ ${INSTALL_PGSQL} = true ]; then \ # Install ZipArchive: ARG INSTALL_ZIP_ARCHIVE=false -RUN if [ ${INSTALL_ZIP_ARCHIVE} = true ]; then \ +RUN set -eux; \ + if [ ${INSTALL_ZIP_ARCHIVE} = true ]; then \ apk --update add libzip-dev && \ - docker-php-ext-configure zip --with-libzip && \ + if [ ${LARADOCK_PHP_VERSION} = "7.3" ] || [ ${LARADOCK_PHP_VERSION} = "7.4" ]; then \ + docker-php-ext-configure zip; \ + else \ + docker-php-ext-configure zip --with-libzip; \ + fi && \ # Install the zip extension docker-php-ext-install zip \ ;fi @@ -75,7 +82,7 @@ RUN if [ ${INSTALL_ZIP_ARCHIVE} = true ]; then \ # Install MySQL Client: ARG INSTALL_MYSQL_CLIENT=false RUN if [ ${INSTALL_MYSQL_CLIENT} = true ]; then \ - if [ ${PHP_VERSION} = "7.3" ]; then \ + if [ ${LARADOCK_PHP_VERSION} = "7.3" ]; then \ apk --update add default-mysql-client \ ;else \ apk --update add mysql-client \