Skip to content

Commit

Permalink
Merge pull request #2502 from bestlong/gmp-ext
Browse files Browse the repository at this point in the history
horizon gmp ext
  • Loading branch information
bestlong committed Feb 12, 2020
2 parents 2f2539a + 53d13f2 commit 719d1f7
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 39 deletions.
7 changes: 4 additions & 3 deletions docker-compose.yml
Expand Up @@ -65,12 +65,12 @@ services:
- LARADOCK_PHALCON_VERSION=${PHALCON_VERSION}
- INSTALL_SUBVERSION=${WORKSPACE_INSTALL_SUBVERSION}
- INSTALL_BZ2=${WORKSPACE_INSTALL_BZ2}
- INSTALL_GMP=${WORKSPACE_INSTALL_GMP}
- INSTALL_XDEBUG=${WORKSPACE_INSTALL_XDEBUG}
- INSTALL_PCOV=${WORKSPACE_INSTALL_PCOV}
- INSTALL_PHPDBG=${WORKSPACE_INSTALL_PHPDBG}
- INSTALL_BLACKFIRE=${INSTALL_BLACKFIRE}
- INSTALL_SSH2=${WORKSPACE_INSTALL_SSH2}
- INSTALL_GMP=${WORKSPACE_INSTALL_GMP}
- INSTALL_SOAP=${WORKSPACE_INSTALL_SOAP}
- INSTALL_XSL=${WORKSPACE_INSTALL_XSL}
- INSTALL_LDAP=${WORKSPACE_INSTALL_LDAP}
Expand Down Expand Up @@ -170,6 +170,7 @@ services:
- LARADOCK_PHP_VERSION=${PHP_VERSION}
- LARADOCK_PHALCON_VERSION=${PHALCON_VERSION}
- INSTALL_BZ2=${PHP_FPM_INSTALL_BZ2}
- INSTALL_GMP=${PHP_FPM_INSTALL_GMP}
- INSTALL_XDEBUG=${PHP_FPM_INSTALL_XDEBUG}
- INSTALL_PCOV=${PHP_FPM_INSTALL_PCOV}
- INSTALL_PHPDBG=${PHP_FPM_INSTALL_PHPDBG}
Expand All @@ -185,7 +186,6 @@ services:
- INSTALL_GEARMAN=${PHP_FPM_INSTALL_GEARMAN}
- INSTALL_MSSQL=${PHP_FPM_INSTALL_MSSQL}
- INSTALL_BCMATH=${PHP_FPM_INSTALL_BCMATH}
- INSTALL_GMP=${PHP_FPM_INSTALL_GMP}
- INSTALL_PHPREDIS=${PHP_FPM_INSTALL_PHPREDIS}
- INSTALL_MEMCACHED=${PHP_FPM_INSTALL_MEMCACHED}
- INSTALL_OPCACHE=${PHP_FPM_INSTALL_OPCACHE}
Expand Down Expand Up @@ -254,6 +254,7 @@ services:
- LARADOCK_PHP_VERSION=${PHP_VERSION}
- PHALCON_VERSION=${PHALCON_VERSION}
- INSTALL_BZ2=${PHP_WORKER_INSTALL_BZ2}
- INSTALL_GMP=${PHP_WORKER_INSTALL_GMP}
- INSTALL_PGSQL=${PHP_WORKER_INSTALL_PGSQL}
- INSTALL_BCMATH=${PHP_WORKER_INSTALL_BCMATH}
- INSTALL_PHALCON=${PHP_WORKER_INSTALL_PHALCON}
Expand All @@ -267,7 +268,6 @@ services:
- INSTALL_SWOOLE=${PHP_WORKER_INSTALL_SWOOLE}
- INSTALL_TAINT=${PHP_WORKER_INSTALL_TAINT}
- INSTALL_FFMPEG=${PHP_WORKER_INSTALL_FFMPEG}
- INSTALL_GMP=${PHP_WORKER_INSTALL_GMP}
- INSTALL_REDIS=${PHP_WORKER_INSTALL_REDIS}
- PUID=${PHP_WORKER_PUID}
- PGID=${PHP_WORKER_PGID}
Expand All @@ -288,6 +288,7 @@ services:
- CHANGE_SOURCE=${CHANGE_SOURCE}
- LARADOCK_PHP_VERSION=${PHP_VERSION}
- INSTALL_BZ2=${LARAVEL_HORIZON_INSTALL_BZ2}
- INSTALL_GMP=${LARAVEL_HORIZON_INSTALL_GMP}
- INSTALL_PGSQL=${PHP_FPM_INSTALL_PGSQL}
- INSTALL_BCMATH=${PHP_FPM_INSTALL_BCMATH}
- INSTALL_MEMCACHED=${PHP_FPM_INSTALL_MEMCACHED}
Expand Down
7 changes: 4 additions & 3 deletions env-example
Expand Up @@ -101,12 +101,12 @@ WORKSPACE_INSTALL_PHPREDIS=true
WORKSPACE_INSTALL_WORKSPACE_SSH=false
WORKSPACE_INSTALL_SUBVERSION=false
WORKSPACE_INSTALL_BZ2=false
WORKSPACE_INSTALL_GMP=false
WORKSPACE_INSTALL_XDEBUG=false
WORKSPACE_INSTALL_PCOV=false
WORKSPACE_INSTALL_PHPDBG=false
WORKSPACE_INSTALL_SSH2=false
WORKSPACE_INSTALL_LDAP=false
WORKSPACE_INSTALL_GMP=false
WORKSPACE_INSTALL_SOAP=false
WORKSPACE_INSTALL_XSL=false
WORKSPACE_INSTALL_SMB=false
Expand Down Expand Up @@ -172,6 +172,7 @@ PHP_FPM_INSTALL_IMAGE_OPTIMIZERS=true
PHP_FPM_INSTALL_PHPREDIS=true
PHP_FPM_INSTALL_MEMCACHED=false
PHP_FPM_INSTALL_BZ2=false
PHP_FPM_INSTALL_GMP=false
PHP_FPM_INSTALL_XDEBUG=false
PHP_FPM_INSTALL_PCOV=false
PHP_FPM_INSTALL_XHPROF=false
Expand All @@ -186,7 +187,6 @@ PHP_FPM_INSTALL_MSSQL=false
PHP_FPM_INSTALL_SSH2=false
PHP_FPM_INSTALL_SOAP=false
PHP_FPM_INSTALL_XSL=false
PHP_FPM_INSTALL_GMP=false
PHP_FPM_INSTALL_EXIF=false
PHP_FPM_INSTALL_AEROSPIKE=false
PHP_FPM_INSTALL_OCI8=false
Expand Down Expand Up @@ -223,6 +223,7 @@ PHP_FPM_PGID=1000
### PHP_WORKER ############################################

PHP_WORKER_INSTALL_BZ2=false
PHP_WORKER_INSTALL_GMP=false
PHP_WORKER_INSTALL_PGSQL=false
PHP_WORKER_INSTALL_BCMATH=false
PHP_WORKER_INSTALL_PHALCON=false
Expand All @@ -234,7 +235,6 @@ PHP_WORKER_INSTALL_GHOSTSCRIPT=false
PHP_WORKER_INSTALL_SWOOLE=false
PHP_WORKER_INSTALL_TAINT=false
PHP_WORKER_INSTALL_FFMPEG=false
PHP_WORKER_INSTALL_GMP=false
PHP_WORKER_INSTALL_CASSANDRA=false
PHP_WORKER_INSTALL_GEARMAN=false
PHP_WORKER_INSTALL_REDIS=false
Expand All @@ -255,6 +255,7 @@ NGINX_SSL_PATH=./nginx/ssl/
### LARAVEL_HORIZON ################################################

LARAVEL_HORIZON_INSTALL_BZ2=false
LARAVEL_HORIZON_INSTALL_GMP=false
LARAVEL_HORIZON_INSTALL_SOCKETS=false
LARAVEL_HORIZON_INSTALL_YAML=false
LARAVEL_HORIZON_INSTALL_PHPREDIS=true
Expand Down
7 changes: 7 additions & 0 deletions laravel-horizon/Dockerfile
Expand Up @@ -53,6 +53,13 @@ RUN if [ ${INSTALL_BZ2} = true ]; then \
docker-php-ext-install bz2 \
;fi

#Install GMP package:
ARG INSTALL_GMP=false
RUN if [ ${INSTALL_GMP} = true ]; then \
apk add --update --no-cache gmp gmp-dev; \
docker-php-ext-install gmp \
;fi

#Install BCMath package:
ARG INSTALL_BCMATH=false
RUN if [ ${INSTALL_BCMATH} = true ]; then \
Expand Down
30 changes: 15 additions & 15 deletions php-fpm/Dockerfile
Expand Up @@ -80,6 +80,21 @@ RUN if [ ${INSTALL_BZ2} = true ]; then \
docker-php-ext-install bz2 \
;fi

###########################################################################
# GMP (GNU Multiple Precision):
###########################################################################

ARG INSTALL_GMP=false

RUN if [ ${INSTALL_GMP} = true ]; then \
# Install the GMP extension
apt-get install -y libgmp-dev && \
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
ln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h \
;fi && \
docker-php-ext-install gmp \
;fi

###########################################################################
# SSH2:
###########################################################################
Expand Down Expand Up @@ -397,21 +412,6 @@ RUN if [ ${INSTALL_BCMATH} = true ]; then \
docker-php-ext-install bcmath \
;fi

###########################################################################
# GMP (GNU Multiple Precision):
###########################################################################

ARG INSTALL_GMP=false

RUN if [ ${INSTALL_GMP} = true ]; then \
# Install the GMP extension
apt-get install -y libgmp-dev && \
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
ln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h \
;fi && \
docker-php-ext-install gmp \
;fi

###########################################################################
# PHP Memcached:
###########################################################################
Expand Down
14 changes: 7 additions & 7 deletions php-worker/Dockerfile
Expand Up @@ -53,6 +53,13 @@ RUN if [ ${INSTALL_BZ2} = true ]; then \
docker-php-ext-install bz2; \
fi

#Install GMP package:
ARG INSTALL_GMP=false
RUN if [ ${INSTALL_GMP} = true ]; then \
apk add --update --no-cache gmp gmp-dev \
&& docker-php-ext-install gmp \
;fi

#Install SOAP package:
ARG INSTALL_SOAP=false
RUN if [ ${INSTALL_SOAP} = true ]; then \
Expand Down Expand Up @@ -162,13 +169,6 @@ RUN if [ $INSTALL_GHOSTSCRIPT = true ]; then \
apk --update add ghostscript \
;fi

#Install GMP package:
ARG INSTALL_GMP=false
RUN if [ ${INSTALL_GMP} = true ]; then \
apk add --update --no-cache gmp gmp-dev \
&& docker-php-ext-install gmp \
;fi

# Install Redis package:
ARG INSTALL_REDIS=false
RUN if [ ${INSTALL_REDIS} = true ]; then \
Expand Down
22 changes: 11 additions & 11 deletions workspace/Dockerfile
Expand Up @@ -242,30 +242,30 @@ RUN if [ ${INSTALL_BZ2} = true ]; then \
;fi

###########################################################################
# SSH2:
# GMP (GNU Multiple Precision):
###########################################################################

USER root

ARG INSTALL_SSH2=false
ARG INSTALL_GMP=false
ARG PHP_VERSION=${LARADOCK_PHP_VERSION}

RUN if [ ${INSTALL_SSH2} = true ]; then \
# Install the PHP SSH2 extension
apt-get -y install libssh2-1-dev php${LARADOCK_PHP_VERSION}-ssh2 \
RUN if [ ${INSTALL_GMP} = true ]; then \
# Install the PHP GMP extension
apt-get -y install php${LARADOCK_PHP_VERSION}-gmp \
;fi

###########################################################################
# GMP:
# SSH2:
###########################################################################

USER root

ARG INSTALL_GMP=false
ARG PHP_VERSION=${LARADOCK_PHP_VERSION}
ARG INSTALL_SSH2=false

RUN if [ ${INSTALL_GMP} = true ]; then \
# Install the PHP GMP extension
apt-get -y install php${LARADOCK_PHP_VERSION}-gmp \
RUN if [ ${INSTALL_SSH2} = true ]; then \
# Install the PHP SSH2 extension
apt-get -y install libssh2-1-dev php${LARADOCK_PHP_VERSION}-ssh2 \
;fi

###########################################################################
Expand Down

2 comments on commit 719d1f7

@dendihandian
Copy link

@dendihandian dendihandian commented on 719d1f7 May 20, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bestlong I got error installing gmp extension using php7.3 and php7.4 in either workspace and php-fpm container.

Step 61/259 : RUN if [ ${INSTALL_GMP} = true ]; then   apt-get -y install php${LARADOCK_PHP_VERSION}-gmp ;fi
 ---> Running in 0489cf61b462
Reading package lists...
Building dependency tree...
Reading state information...
The following NEW packages will be installed:
  php7.3-gmp
0 upgraded, 1 newly installed, 0 to remove and 67 not upgraded.
Need to get 20.2 kB of archives.
After this operation, 98.3 kB of additional disk space will be used.
Err:1 http://ppa.launchpad.net/ondrej/php/ubuntu xenial/main amd64 php7.3-gmp amd64 7.3.17-1+ubuntu16.04.1+deb.sury.org+1
  404  Not Found
E: Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php7.3/php7.3-gmp_7.3.17-1+ubuntu16.04.1+deb.sury.org+1_amd64.deb  404  Not Found

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
ERROR: Service 'workspace' failed to build: The command '/bin/sh -c if [ ${INSTALL_GMP} = true ]; then   apt-get -y install php${LARADOCK_PHP_VERSION}-gmp ;fi' returned a non-zero code: 100

@bestlong
Copy link
Member Author

@bestlong bestlong commented on 719d1f7 May 20, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dendihandian
maybe cache problem
try docker-compose build --no-cache php-fpm workspace

Please sign in to comment.