From fb22fbf0d7be9c3a71053cebbb1673e616e14df2 Mon Sep 17 00:00:00 2001 From: Marcelo Camargo Date: Mon, 7 Mar 2022 01:10:38 -0300 Subject: [PATCH] Add extension zmq --- .env.example | 2 ++ docker-compose.yml | 2 ++ php-fpm/Dockerfile | 21 +++++++++++++++++++++ workspace/Dockerfile | 24 ++++++++++++++++++++++++ 4 files changed, 49 insertions(+) diff --git a/.env.example b/.env.example index d09ac3ba..0c27f7cf 100644 --- a/.env.example +++ b/.env.example @@ -134,6 +134,7 @@ WORKSPACE_INSTALL_IMAP=false WORKSPACE_INSTALL_MONGO=false WORKSPACE_INSTALL_AMQP=false WORKSPACE_INSTALL_CASSANDRA=false +WORKSPACE_INSTALL_ZMQ=false WORKSPACE_INSTALL_GEARMAN=false WORKSPACE_INSTALL_MSSQL=false WORKSPACE_INSTALL_DRUSH=false @@ -228,6 +229,7 @@ PHP_FPM_INSTALL_IMAP=false PHP_FPM_INSTALL_MONGO=false PHP_FPM_INSTALL_AMQP=false PHP_FPM_INSTALL_CASSANDRA=false +PHP_FPM_INSTALL_ZMQ=false PHP_FPM_INSTALL_GEARMAN=false PHP_FPM_INSTALL_MSSQL=false PHP_FPM_INSTALL_SSH2=false diff --git a/docker-compose.yml b/docker-compose.yml index 4820ab40..696884d7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -86,6 +86,7 @@ services: - INSTALL_MONGO=${WORKSPACE_INSTALL_MONGO} - INSTALL_AMQP=${WORKSPACE_INSTALL_AMQP} - INSTALL_CASSANDRA=${WORKSPACE_INSTALL_CASSANDRA} + - INSTALL_ZMQ=${WORKSPACE_INSTALL_ZMQ} - INSTALL_GEARMAN=${WORKSPACE_INSTALL_GEARMAN} - INSTALL_PHPREDIS=${WORKSPACE_INSTALL_PHPREDIS} - INSTALL_MSSQL=${WORKSPACE_INSTALL_MSSQL} @@ -226,6 +227,7 @@ services: - INSTALL_MONGO=${PHP_FPM_INSTALL_MONGO} - INSTALL_AMQP=${PHP_FPM_INSTALL_AMQP} - INSTALL_CASSANDRA=${PHP_FPM_INSTALL_CASSANDRA} + - INSTALL_ZMQ=${PHP_FPM_INSTALL_ZMQ} - INSTALL_GEARMAN=${PHP_FPM_INSTALL_GEARMAN} - INSTALL_MSSQL=${PHP_FPM_INSTALL_MSSQL} - INSTALL_BCMATH=${PHP_FPM_INSTALL_BCMATH} diff --git a/php-fpm/Dockerfile b/php-fpm/Dockerfile index 206dfa77..d6eff7e8 100644 --- a/php-fpm/Dockerfile +++ b/php-fpm/Dockerfile @@ -1215,6 +1215,27 @@ RUN if [ ${DOWNGRADE_OPENSSL_TLS_AND_SECLEVEL} = true ]; then \ sed -i 's,^\(CipherString[ ]*=\).*,\1'DEFAULT@SECLEVEL=1',g' /etc/ssl/openssl.cnf\ ;fi +########################################################################### +# zmq +########################################################################### + +USER root + +ARG INSTALL_ZMQ=false + +RUN if [ ${INSTALL_ZMQ} = true ]; then \ + apt-get install --yes git libzmq3-dev \ + && git clone git://github.com/mkoppanen/php-zmq.git \ + && cd php-zmq \ + && phpize \ + && ./configure \ + && make \ + && make install \ + && cd .. \ + && rm -fr php-zmq \ + && echo "extension=zmq.so" > /usr/local/etc/php/conf.d/zmq.ini \ +;fi + ########################################################################### # Check PHP version: ########################################################################### diff --git a/workspace/Dockerfile b/workspace/Dockerfile index 36364021..417069bd 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -1707,6 +1707,30 @@ RUN if [ ${INSTALL_TRADER} = true ]; then \ && ln -s /etc/php/${LARADOCK_PHP_VERSION}/mods-available/trader.ini /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/20-trader.ini \ ;fi +# +#-------------------------------------------------------------------------- +# zmq +#-------------------------------------------------------------------------- +# + +USER root + +ARG INSTALL_ZMQ=false + +RUN if [ ${INSTALL_ZMQ} = true ]; then \ + apt-get install --yes git libzmq3-dev \ + && git clone git://github.com/mkoppanen/php-zmq.git \ + && cd php-zmq \ + && phpize \ + && ./configure \ + && make \ + && make install \ + && cd .. \ + && rm -fr php-zmq \ + && echo "extension=zmq.so" >> /etc/php/${LARADOCK_PHP_VERSION}/mods-available/zmq.ini \ + && ln -s /etc/php/${LARADOCK_PHP_VERSION}/mods-available/zmq.ini /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/20-zmq.ini \ +;fi + # #-------------------------------------------------------------------------- # Final Touch