support zookeeper extension #2927

This commit is contained in:
Shao Yu-Lung (Allen) 2021-04-05 18:34:49 +08:00
parent 8fcabc3938
commit 409ec06f9a
4 changed files with 55 additions and 0 deletions

View File

@ -166,6 +166,7 @@ services:
- INSTALL_LNAV=${WORKSPACE_INSTALL_LNAV}
- INSTALL_PROTOC=${WORKSPACE_INSTALL_PROTOC}
- INSTALL_PHPDECIMAL=${WORKSPACE_INSTALL_PHPDECIMAL}
- INSTALL_ZOOKEEPER=${WORKSPACE_INSTALL_ZOOKEEPER}
- PROTOC_VERSION=${WORKSPACE_PROTOC_VERSION}
- INSTALL_DOCKER_CLIENT=${WORKSPACE_INSTALL_DOCKER_CLIENT}
- http_proxy
@ -263,6 +264,7 @@ services:
- INSTALL_XHPROF=${PHP_FPM_INSTALL_XHPROF}
- INSTALL_XMLRPC=${PHP_FPM_INSTALL_XMLRPC}
- INSTALL_PHPDECIMAL=${PHP_FPM_INSTALL_PHPDECIMAL}
- INSTALL_ZOOKEEPER=${PHP_FPM_INSTALL_ZOOKEEPER}
- DOWNGRADE_OPENSSL_TLS_AND_SECLEVEL=${PHP_DOWNGRADE_OPENSSL_TLS_AND_SECLEVEL}
- PUID=${PHP_FPM_PUID}
- PGID=${PHP_FPM_PGID}

View File

@ -198,6 +198,7 @@ WORKSPACE_INSTALL_DOCKER_CLIENT=false
WORKSPACE_INSTALL_LNAV=false
WORKSPACE_INSTALL_PROTOC=false
WORKSPACE_INSTALL_PHPDECIMAL=false
WORKSPACE_INSTALL_ZOOKEEPER=false
WORKSPACE_PROTOC_VERSION=latest
### PHP_FPM ###############################################
@ -258,6 +259,7 @@ PHP_FPM_INSTALL_SSHPASS=false
PHP_FPM_INSTALL_MAILPARSE=false
PHP_FPM_INSTALL_WKHTMLTOPDF=false
PHP_FPM_INSTALL_PHPDECIMAL=false
PHP_FPM_INSTALL_ZOOKEEPER=false
PHP_FPM_FFMPEG=false
PHP_FPM_AUDIOWAVEFORM=false
PHP_FPM_ADDITIONAL_LOCALES="en_US.UTF-8 es_ES.UTF-8 fr_FR.UTF-8"

View File

@ -1094,6 +1094,31 @@ RUN if [ ${INSTALL_PHPDECIMAL} = true ]; then \
;fi \
;fi
###########################################################################
# zookeeper
###########################################################################
ARG INSTALL_ZOOKEEPER=false
RUN set -eux; \
if [ ${INSTALL_ZOOKEEPER} = true ]; then \
apt install -yqq libzookeeper-mt-dev; \
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "8" ]; then \
curl -L -o /tmp/php-zookeeper.tar.gz https://github.com/php-zookeeper/php-zookeeper/archive/master.tar.gz; \
mkdir -p /tmp/php-zookeeper; \
tar -C /tmp/php-zookeeper -zxvf /tmp/php-zookeeper.tar.gz --strip 1; \
cd /tmp/php-zookeeper; \
phpize && ./configure && make && make install;\
else \
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
pecl install zookeeper-0.5.0; \
else \
pecl install zookeeper-0.7.2; \
fi; \
fi; \
docker-php-ext-enable zookeeper; \
php -m | grep -q 'zookeeper'; \
fi
###########################################################################
# New Relic for PHP:
###########################################################################

View File

@ -1600,6 +1600,32 @@ RUN if [ ${INSTALL_PHPDECIMAL} = true ]; then \
;fi \
;fi
###########################################################################
# zookeeper
###########################################################################
ARG INSTALL_ZOOKEEPER=false
RUN set -eux; \
if [ ${INSTALL_ZOOKEEPER} = true ]; then \
apt install -yqq libzookeeper-mt-dev; \
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "8" ]; then \
curl -L -o /tmp/php-zookeeper.tar.gz https://github.com/php-zookeeper/php-zookeeper/archive/master.tar.gz; \
mkdir -p /tmp/php-zookeeper; \
tar -C /tmp/php-zookeeper -zxvf /tmp/php-zookeeper.tar.gz --strip 1; \
cd /tmp/php-zookeeper; \
phpize && ./configure && make && make install;\
else \
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
pecl install zookeeper-0.5.0; \
else \
pecl install zookeeper-0.7.2; \
fi; \
fi; \
echo "extension=zookeeper.so" >> /etc/php/${LARADOCK_PHP_VERSION}/mods-available/zookeeper.ini; \
ln -s /etc/php/${LARADOCK_PHP_VERSION}/mods-available/zookeeper.ini /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/30-zookeeper.ini; \
php -m | grep -q 'zookeeper'; \
fi
#
#--------------------------------------------------------------------------
# Final Touch