From b28f44955681244da1a7b04c013a667ae68b825d Mon Sep 17 00:00:00 2001 From: Scott Collier Date: Mon, 20 Jan 2020 12:24:18 -0600 Subject: [PATCH 01/11] Add bash-git-prompt in order to have a more descriptive prompt when working with repositories. Also, update documentation for bash-git-prompt usage --- DOCUMENTATION/content/documentation/index.md | 19 ++++++++++++++++ docker-compose.yml | 1 + env-example | 1 + workspace/Dockerfile | 13 +++++++++++ workspace/git-prompt.sh | 24 ++++++++++++++++++++ 5 files changed, 58 insertions(+) create mode 100644 workspace/git-prompt.sh diff --git a/DOCUMENTATION/content/documentation/index.md b/DOCUMENTATION/content/documentation/index.md index 14d5be0..d007bca 100644 --- a/DOCUMENTATION/content/documentation/index.md +++ b/DOCUMENTATION/content/documentation/index.md @@ -2052,6 +2052,25 @@ AST exposes the abstract syntax tree generated by PHP 7+. This extension is requ +
+ +## Install Git Bash Prompt +A bash prompt that displays information about the current git repository. In particular the branch name, difference with remote branch, number of files staged, changed, etc. + +1 - Open the `.env` file + +2 - Search for the `WORKSPACE_INSTALL_GIT_PROMPT` argument under the Workspace Container + +3 - Set it to `true` + +4 - Re-build the container `docker-compose build workspace` + +**Note** You can configure bash-git-prompt by editing the `workspace/gitprompt.sh` file and re-building the workspace container. +For configuration information, visit the [bash-git-prompt repository](https://github.com/magicmonty/bash-git-prompt). + + + +
## PHPStorm Debugging Guide diff --git a/docker-compose.yml b/docker-compose.yml index 7f1543f..bb75128 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -125,6 +125,7 @@ services: - INSTALL_AST=${WORKSPACE_INSTALL_AST} - INSTALL_YAML=${WORKSPACE_INSTALL_YAML} - INSTALL_MAILPARSE=${WORKSPACE_INSTALL_MAILPARSE} + - INSTALL_GIT_PROMPT=${WORKSPACE_INSTALL_GIT_PROMPT} - PUID=${WORKSPACE_PUID} - PGID=${WORKSPACE_PGID} - CHROME_DRIVER_VERSION=${WORKSPACE_CHROME_DRIVER_VERSION} diff --git a/env-example b/env-example index feecbd6..256288d 100644 --- a/env-example +++ b/env-example @@ -158,6 +158,7 @@ WORKSPACE_INSTALL_FFMPEG=false WORKSPACE_INSTALL_GNU_PARALLEL=false WORKSPACE_INSTALL_AST=true WORKSPACE_AST_VERSION=1.0.3 +WORKSPACE_INSTALL_GIT_PROMPT=true ### PHP_FPM ############################################### diff --git a/workspace/Dockerfile b/workspace/Dockerfile index 6223e0a..3bf6872 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -1253,6 +1253,19 @@ RUN if [ ${INSTALL_GNU_PARALLEL} = true ]; then \ apt-get -y install parallel \ ;fi +########################################################################### +# Bash Git Prompt +########################################################################### + +ARG INSTALL_GIT_PROMPT=false + +COPY git-prompt.sh /tmp/git-prompt + +RUN if [ ${INSTALL_GIT_PROMPT} = true ]; then \ + git clone https://github.com/magicmonty/bash-git-prompt.git /root/.bash-git-prompt --depth=1 && \ + cat /tmp/git-prompt >> /root/.bashrc && \ + rm /tmp/git-prompt \ +;fi ########################################################################### # Check PHP version: diff --git a/workspace/git-prompt.sh b/workspace/git-prompt.sh new file mode 100644 index 0000000..374e9fa --- /dev/null +++ b/workspace/git-prompt.sh @@ -0,0 +1,24 @@ +# Settings info at https://github.com/magicmonty/bash-git-prompt +if [ -f "$HOME/.bash-git-prompt/gitprompt.sh" ]; then + # Set config variables first + GIT_PROMPT_ONLY_IN_REPO=1 + GIT_PROMPT_FETCH_REMOTE_STATUS=0 # uncomment to avoid fetching remote status + GIT_PROMPT_IGNORE_SUBMODULES=1 # uncomment to avoid searching for changed files in submodules + # GIT_PROMPT_WITH_VIRTUAL_ENV=0 # uncomment to avoid setting virtual environment infos for node/python/conda environments + + # GIT_PROMPT_SHOW_UPSTREAM=1 # uncomment to show upstream tracking branch + # GIT_PROMPT_SHOW_UNTRACKED_FILES=normal # can be no, normal or all; determines counting of untracked files + + # GIT_PROMPT_SHOW_CHANGED_FILES_COUNT=0 # uncomment to avoid printing the number of changed files + + # GIT_PROMPT_STATUS_COMMAND=gitstatus_pre-1.7.10.sh # uncomment to support Git older than 1.7.10 + + # GIT_PROMPT_START=... # uncomment for custom prompt start sequence + # GIT_PROMPT_END=... # uncomment for custom prompt end sequence + + # as last entry source the gitprompt script + # GIT_PROMPT_THEME=Custom # use custom theme specified in file GIT_PROMPT_THEME_FILE (default ~/.git-prompt-colors.sh) + # GIT_PROMPT_THEME_FILE=~/.git-prompt-colors.sh + # GIT_PROMPT_THEME=Solarized # use theme optimized for solarized color scheme + source $HOME/.bash-git-prompt/gitprompt.sh +fi From 7fec2186ef0a140a19c603d7406614bb4c321e18 Mon Sep 17 00:00:00 2001 From: Scott Collier Date: Mon, 20 Jan 2020 12:25:44 -0600 Subject: [PATCH 02/11] Add bash-git-prompt in order to have a more descriptive prompt when working with repositories. Also, update documentation for bash-git-prompt usage. Make sure initial value for usage is false. --- env-example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/env-example b/env-example index 256288d..a98d14b 100644 --- a/env-example +++ b/env-example @@ -158,7 +158,7 @@ WORKSPACE_INSTALL_FFMPEG=false WORKSPACE_INSTALL_GNU_PARALLEL=false WORKSPACE_INSTALL_AST=true WORKSPACE_AST_VERSION=1.0.3 -WORKSPACE_INSTALL_GIT_PROMPT=true +WORKSPACE_INSTALL_GIT_PROMPT=false ### PHP_FPM ############################################### From 5aafed586be0aade83a20928d0d45bb508521478 Mon Sep 17 00:00:00 2001 From: Nathanael Date: Wed, 22 Jan 2020 15:37:04 -0300 Subject: [PATCH 03/11] upgraded elasticsearch, logstash and kibana images and provided an environment variable to specify a version for the entire ELK stack. --- docker-compose.yml | 15 ++++++++++++--- elasticsearch/Dockerfile | 3 ++- env-example | 3 +++ kibana/Dockerfile | 3 ++- logstash/Dockerfile | 3 ++- 5 files changed, 21 insertions(+), 6 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index fdab141..26bd204 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -770,7 +770,10 @@ services: ### ElasticSearch ######################################## elasticsearch: - build: ./elasticsearch + build: + context: ./elasticsearch + args: + - ELK_VERSION=${ELK_VERSION} volumes: - elasticsearch:/usr/share/elasticsearch/data environment: @@ -794,7 +797,10 @@ services: ### Logstash ############################################## logstash: - build: ./logstash + build: + context: ./logstash + args: + - ELK_VERSION=${ELK_VERSION} volumes: - './logstash/config/logstash.yml:/usr/share/logstash/config/logstash.yml' - './logstash/pipeline:/usr/share/logstash/pipeline' @@ -812,7 +818,10 @@ services: ### Kibana ############################################## kibana: - build: ./kibana + build: + context: ./kibana + args: + - ELK_VERSION=${ELK_VERSION} ports: - "${KIBANA_HTTP_PORT}:5601" depends_on: diff --git a/elasticsearch/Dockerfile b/elasticsearch/Dockerfile index dcc2874..7d77e07 100644 --- a/elasticsearch/Dockerfile +++ b/elasticsearch/Dockerfile @@ -1,3 +1,4 @@ -FROM docker.elastic.co/elasticsearch/elasticsearch:7.1.1 +ARG ELK_VERSION=7.5.1 +FROM docker.elastic.co/elasticsearch/elasticsearch:${ELK_VERSION} EXPOSE 9200 9300 diff --git a/env-example b/env-example index c521fd0..46ad004 100644 --- a/env-example +++ b/env-example @@ -848,3 +848,6 @@ GEARMAN_MYSQL_PASSWORD_FILE= GEARMAN_MYSQL_DB=Gearmand # Table to use by Gearman (Default: gearman_queue) GEARMAN_MYSQL_TABLE=gearman_queue + +### ELK Stack ################################################## +ELK_VERSION=7.5.1 diff --git a/kibana/Dockerfile b/kibana/Dockerfile index b831d6d..46ef653 100644 --- a/kibana/Dockerfile +++ b/kibana/Dockerfile @@ -1,3 +1,4 @@ -FROM docker.elastic.co/kibana/kibana:7.1.1 +ARG ELK_VERSION=7.5.1 +FROM docker.elastic.co/kibana/kibana:${ELK_VERSION} EXPOSE 5601 diff --git a/logstash/Dockerfile b/logstash/Dockerfile index a8c5452..161d381 100644 --- a/logstash/Dockerfile +++ b/logstash/Dockerfile @@ -1,4 +1,5 @@ -FROM docker.elastic.co/logstash/logstash:6.4.2 +ARG ELK_VERSION=7.5.1 +FROM docker.elastic.co/logstash/logstash:${ELK_VERSION} USER root RUN rm -f /usr/share/logstash/pipeline/logstash.conf From 8b4391e63ca9260a29177d368fbf5eb7b494fd6f Mon Sep 17 00:00:00 2001 From: Saulo Paiva Date: Sat, 25 Jan 2020 11:23:48 -0300 Subject: [PATCH 04/11] Use MYSQL_VERSION env var to build mysql image --- mysql/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql/Dockerfile b/mysql/Dockerfile index 03bb15c..870a5e4 100644 --- a/mysql/Dockerfile +++ b/mysql/Dockerfile @@ -1,4 +1,4 @@ -ARG MYSQL_VERSION=latest +ARG MYSQL_VERSION FROM mysql:${MYSQL_VERSION} LABEL maintainer="Mahmoud Zalt " From b26bcdb42a403d060ad366d90d8218f3af28e34c Mon Sep 17 00:00:00 2001 From: Shao Yu Lung Date: Wed, 5 Feb 2020 14:54:57 +0800 Subject: [PATCH 05/11] 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 0fa1a0d..e352a29 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 d9733e5..388940e 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 \ From 63b3d2ff14b58ee582d1b462397082f6cde2ce48 Mon Sep 17 00:00:00 2001 From: Shao Yu Lung Date: Thu, 6 Feb 2020 23:58:07 +0800 Subject: [PATCH 06/11] postgresql version can specify --- docker-compose.yml | 5 ++++- env-example | 1 + postgres/Dockerfile | 5 ++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 1aabe82..3c4f843 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -469,7 +469,10 @@ services: ### PostgreSQL ########################################### postgres: - build: ./postgres + build: + context: ./postgres + args: + - POSTGRES_VERSION=${POSTGRES_VERSION} volumes: - ${DATA_PATH_HOST}/postgres:/var/lib/postgresql/data - ${POSTGRES_ENTRYPOINT_INITDB}:/docker-entrypoint-initdb.d diff --git a/env-example b/env-example index fd14dc2..dbbbdf5 100644 --- a/env-example +++ b/env-example @@ -316,6 +316,7 @@ MARIADB_ENTRYPOINT_INITDB=./mariadb/docker-entrypoint-initdb.d ### POSTGRES ############################################## +POSTGRES_VERSION=alpine POSTGRES_DB=default POSTGRES_USER=default POSTGRES_PASSWORD=secret diff --git a/postgres/Dockerfile b/postgres/Dockerfile index b5f121c..67b5ea2 100644 --- a/postgres/Dockerfile +++ b/postgres/Dockerfile @@ -1,6 +1,5 @@ -FROM postgres:alpine - -LABEL maintainer="Ben M " +ARG POSTGRES_VERSION=alpine +FROM postgres:${POSTGRES_VERSION} CMD ["postgres"] From 66134095b1ca6092195adf0179c976369638e1a3 Mon Sep 17 00:00:00 2001 From: Mahmoud Zalt Date: Fri, 7 Feb 2020 22:13:23 +0100 Subject: [PATCH 07/11] update stale bot configuration to close staled issues in 21 days --- .github/stale.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/stale.yml b/.github/stale.yml index f3c36da..dfadd79 100644 --- a/.github/stale.yml +++ b/.github/stale.yml @@ -1,21 +1,21 @@ -# Configuration for probot-stale - https://github.com/probot/stale +# Configuration for Github probot-stale - https://github.com/probot/stale # Number of days of inactivity before an issue becomes stale -daysUntilStale: 180 +daysUntilStale: 90 # Number of days of inactivity before a stale issue is closed -daysUntilClose: 90 +daysUntilClose: 21 # Issues with these labels will never be considered stale exemptLabels: - 'Type: Feature Request' # Label to use when marking an issue as stale -staleLabel: stale +staleLabel: Stale # Comment to post when marking an issue as stale. Set to `false` to disable markComment: > - This issue has been automatically marked as stale because it has not had - recent activity. It will be closed if no further activity occurs. Thank you - for your contributions. + Hi 👋 this issue has been automatically marked as `stale` 📌 because it has not had recent activity 😴. + It will be closed if no further activity occurs. Thank you for your contributions ❤️. # Comment to post when closing a stale issue. Set to `false` to disable closeComment: > - This issue has been automatically closed because it had not recent activity during the stale period. + Hi again 👋 we would like to inform you that this issue has been automatically `closed` 🔒 because it had not recent activity during the `stale` period. + We really really appreciate your contributions, and looking forward for more in the future 🎈. # Limit to only `issues` or `pulls` only: issues From 29def5f0b4dd675838ee5302ee47edd874be850f Mon Sep 17 00:00:00 2001 From: Mahmoud Zalt Date: Fri, 7 Feb 2020 23:10:44 +0100 Subject: [PATCH 08/11] add some missing social media meta tags to the website --- .../layouts/partials/head.html | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/DOCUMENTATION/themes/hugo-material-docs/layouts/partials/head.html b/DOCUMENTATION/themes/hugo-material-docs/layouts/partials/head.html index 0953395..e890c0a 100644 --- a/DOCUMENTATION/themes/hugo-material-docs/layouts/partials/head.html +++ b/DOCUMENTATION/themes/hugo-material-docs/layouts/partials/head.html @@ -12,17 +12,23 @@ {{ .Title }}{{ if not .IsHome }} - {{ .Site.Title }}{{ end }} {{ .Hugo.Generator }} - {{ with .Site.Params.description }} - - {{ end }} + {{ with .Site.Params.description }}{{ end }} - {{ with .Site.Params.author }} - - {{ end }} + {{ with .Site.Params.author }}{{ end }} + + {{ with .Site.Title }}{{ end }} + {{ with .Site.Params.description }}{{ end }} {{ with .Site.Title }}{{ end }} {{ with .Site.Params.logo }}{{ end }} + + + + {{ with .Site.Title }}{{ end }} + {{ with .Site.Params.description }}{{ end }} + {{ with .Site.Params.logo }}{{ end }} + {{ with .Site.Title }}{{ end }} From b2ae5f6d44533f057a296f038228aed330a59a25 Mon Sep 17 00:00:00 2001 From: "Shao Yu-Lung (Allen)" Date: Tue, 11 Feb 2020 18:41:19 +0800 Subject: [PATCH 09/11] Arrange (#2499) * unify php verson variable * CASSANDRA move together * unify all php base container --- docker-compose.yml | 2 +- laravel-horizon/Dockerfile | 18 ++++++++++-------- php-fpm/Dockerfile | 9 +-------- workspace/Dockerfile | 1 - 4 files changed, 12 insertions(+), 18 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 3c4f843..c3250a6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -282,7 +282,7 @@ services: context: ./laravel-horizon args: - CHANGE_SOURCE=${CHANGE_SOURCE} - - PHP_VERSION=${PHP_VERSION} + - LARADOCK_PHP_VERSION=${PHP_VERSION} - INSTALL_PGSQL=${PHP_FPM_INSTALL_PGSQL} - INSTALL_BCMATH=${PHP_FPM_INSTALL_BCMATH} - INSTALL_MEMCACHED=${PHP_FPM_INSTALL_MEMCACHED} diff --git a/laravel-horizon/Dockerfile b/laravel-horizon/Dockerfile index 49d0495..696a160 100644 --- a/laravel-horizon/Dockerfile +++ b/laravel-horizon/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 @@ -63,12 +65,6 @@ RUN if [ ${INSTALL_PGSQL} = true ]; then \ && docker-php-ext-install pdo_pgsql \ ;fi -# Install Cassandra drivers: -ARG INSTALL_CASSANDRA=false -RUN if [ ${INSTALL_CASSANDRA} = true ]; then \ - apk --update add cassandra-cpp-driver \ - ;fi - # Install PhpRedis package: ARG INSTALL_PHPREDIS=false RUN if [ ${INSTALL_PHPREDIS} = true ]; then \ @@ -84,6 +80,12 @@ RUN if [ ${INSTALL_FFMPEG} = true ]; then \ apk add ffmpeg \ ;fi +# Install Cassandra drivers: +ARG INSTALL_CASSANDRA=false +RUN if [ ${INSTALL_CASSANDRA} = true ]; then \ + apk --update add cassandra-cpp-driver \ + ;fi + WORKDIR /usr/src RUN if [ ${INSTALL_CASSANDRA} = true ]; then \ git clone https://github.com/datastax/php-driver.git \ diff --git a/php-fpm/Dockerfile b/php-fpm/Dockerfile index 1d6a8bf..a36aaf5 100644 --- a/php-fpm/Dockerfile +++ b/php-fpm/Dockerfile @@ -13,7 +13,6 @@ # ARG LARADOCK_PHP_VERSION - FROM laradock/php-fpm:2.7-${LARADOCK_PHP_VERSION} LABEL maintainer="Mahmoud Zalt " @@ -194,7 +193,6 @@ RUN if [ ${INSTALL_PCOV} = true ]; then \ ;fi \ ;fi - ########################################################################### # Phpdbg: ########################################################################### @@ -330,7 +328,7 @@ ARG INSTALL_AMQP=false RUN if [ ${INSTALL_AMQP} = true ]; then \ # download and install manually, to make sure it's compatible with ampq installed by pecl later # install cmake first - apt-get update && apt-get -y install cmake && \ + apt-get -y install cmake && \ curl -L -o /tmp/rabbitmq-c.tar.gz https://github.com/alanxz/rabbitmq-c/archive/master.tar.gz && \ mkdir -p rabbitmq-c && \ tar -C rabbitmq-c -zxvf /tmp/rabbitmq-c.tar.gz --strip 1 && \ @@ -352,7 +350,6 @@ RUN if [ ${INSTALL_AMQP} = true ]; then \ ARG INSTALL_GEARMAN=false RUN if [ ${INSTALL_GEARMAN} = true ]; then \ - apt-get update && \ apt-get -y install libgearman-dev && \ cd /tmp && \ curl -L https://github.com/wcgallego/pecl-gearman/archive/gearman-2.0.5.zip -O && \ @@ -799,7 +796,6 @@ USER root ARG INSTALL_MYSQL_CLIENT=false RUN if [ ${INSTALL_MYSQL_CLIENT} = true ]; then \ - apt-get update -yqq && \ if [ ${LARADOCK_PHP_VERSION} = "7.3" ]; then \ apt-get -y install default-mysql-client \ ;else \ @@ -816,7 +812,6 @@ USER root ARG INSTALL_PING=false RUN if [ ${INSTALL_PING} = true ]; then \ - apt-get update -yqq && \ apt-get -y install inetutils-ping \ ;fi @@ -829,7 +824,6 @@ USER root ARG INSTALL_SSHPASS=false RUN if [ ${INSTALL_SSHPASS} = true ]; then \ - apt-get update -yqq && \ apt-get -y install sshpass \ ;fi @@ -842,7 +836,6 @@ USER root ARG INSTALL_FFMPEG=false RUN if [ ${INSTALL_FFMPEG} = true ]; then \ - apt-get update -yqq && \ apt-get -y install ffmpeg \ ;fi diff --git a/workspace/Dockerfile b/workspace/Dockerfile index 6223e0a..0fa66a4 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -13,7 +13,6 @@ # ARG LARADOCK_PHP_VERSION - FROM laradock/workspace:2.6.1-${LARADOCK_PHP_VERSION} LABEL maintainer="Mahmoud Zalt " From f8b7404263d60b597995880a5e7bd2e6221ebf8f Mon Sep 17 00:00:00 2001 From: "Shao Yu-Lung (Allen)" Date: Tue, 11 Feb 2020 23:56:58 +0800 Subject: [PATCH 10/11] php ext bz2 (#2500) * php ext bz2 * fix typo * fix php-fpm bz2 ext * fix horizon bz2 ext --- docker-compose.yml | 4 ++++ env-example | 4 ++++ laravel-horizon/Dockerfile | 7 +++++++ php-fpm/Dockerfile | 10 ++++++++++ php-worker/Dockerfile | 7 +++++++ workspace/Dockerfile | 9 +++++++++ 6 files changed, 41 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index c3250a6..72e8645 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -64,6 +64,7 @@ services: - LARADOCK_PHP_VERSION=${PHP_VERSION} - LARADOCK_PHALCON_VERSION=${PHALCON_VERSION} - INSTALL_SUBVERSION=${WORKSPACE_INSTALL_SUBVERSION} + - INSTALL_BZ2=${WORKSPACE_INSTALL_BZ2} - INSTALL_XDEBUG=${WORKSPACE_INSTALL_XDEBUG} - INSTALL_PCOV=${WORKSPACE_INSTALL_PCOV} - INSTALL_PHPDBG=${WORKSPACE_INSTALL_PHPDBG} @@ -167,6 +168,7 @@ services: - CHANGE_SOURCE=${CHANGE_SOURCE} - LARADOCK_PHP_VERSION=${PHP_VERSION} - LARADOCK_PHALCON_VERSION=${PHALCON_VERSION} + - INSTALL_BZ2=${PHP_FPM_INSTALL_BZ2} - INSTALL_XDEBUG=${PHP_FPM_INSTALL_XDEBUG} - INSTALL_PCOV=${PHP_FPM_INSTALL_PCOV} - INSTALL_PHPDBG=${PHP_FPM_INSTALL_PHPDBG} @@ -250,6 +252,7 @@ services: - CHANGE_SOURCE=${CHANGE_SOURCE} - LARADOCK_PHP_VERSION=${PHP_VERSION} - PHALCON_VERSION=${PHALCON_VERSION} + - INSTALL_BZ2=${PHP_WORKER_INSTALL_BZ2} - INSTALL_PGSQL=${PHP_WORKER_INSTALL_PGSQL} - INSTALL_BCMATH=${PHP_WORKER_INSTALL_BCMATH} - INSTALL_PHALCON=${PHP_WORKER_INSTALL_PHALCON} @@ -283,6 +286,7 @@ services: args: - CHANGE_SOURCE=${CHANGE_SOURCE} - LARADOCK_PHP_VERSION=${PHP_VERSION} + - INSTALL_BZ2=${LARAVEL_HORIZON_INSTALL_BZ2} - INSTALL_PGSQL=${PHP_FPM_INSTALL_PGSQL} - INSTALL_BCMATH=${PHP_FPM_INSTALL_BCMATH} - INSTALL_MEMCACHED=${PHP_FPM_INSTALL_MEMCACHED} diff --git a/env-example b/env-example index dbbbdf5..05358cf 100644 --- a/env-example +++ b/env-example @@ -100,6 +100,7 @@ WORKSPACE_INSTALL_NPM_ANGULAR_CLI=false WORKSPACE_INSTALL_PHPREDIS=true WORKSPACE_INSTALL_WORKSPACE_SSH=false WORKSPACE_INSTALL_SUBVERSION=false +WORKSPACE_INSTALL_BZ2=false WORKSPACE_INSTALL_XDEBUG=false WORKSPACE_INSTALL_PCOV=false WORKSPACE_INSTALL_PHPDBG=false @@ -169,6 +170,7 @@ PHP_FPM_INSTALL_OPCACHE=true PHP_FPM_INSTALL_IMAGE_OPTIMIZERS=true PHP_FPM_INSTALL_PHPREDIS=true PHP_FPM_INSTALL_MEMCACHED=false +PHP_FPM_INSTALL_BZ2=false PHP_FPM_INSTALL_XDEBUG=false PHP_FPM_INSTALL_PCOV=false PHP_FPM_INSTALL_XHPROF=false @@ -219,6 +221,7 @@ PHP_FPM_PGID=1000 ### PHP_WORKER ############################################ +PHP_WORKER_INSTALL_BZ2=false PHP_WORKER_INSTALL_PGSQL=false PHP_WORKER_INSTALL_BCMATH=false PHP_WORKER_INSTALL_PHALCON=false @@ -250,6 +253,7 @@ NGINX_SSL_PATH=./nginx/ssl/ ### LARAVEL_HORIZON ################################################ +LARAVEL_HORIZON_INSTALL_BZ2=false LARAVEL_HORIZON_INSTALL_SOCKETS=false LARAVEL_HORIZON_INSTALL_YAML=false LARAVEL_HORIZON_INSTALL_PHPREDIS=true diff --git a/laravel-horizon/Dockerfile b/laravel-horizon/Dockerfile index 696a160..965cf26 100644 --- a/laravel-horizon/Dockerfile +++ b/laravel-horizon/Dockerfile @@ -46,6 +46,13 @@ ENV PGID ${PGID} RUN addgroup -g ${PGID} laradock && \ adduser -D -G laradock -u ${PUID} laradock +#Install BZ2: +ARG INSTALL_BZ2=false +RUN if [ ${INSTALL_BZ2} = true ]; then \ + apk --update add bzip2-dev; \ + docker-php-ext-install bz2 \ +;fi + #Install BCMath package: ARG INSTALL_BCMATH=false RUN if [ ${INSTALL_BCMATH} = true ]; then \ diff --git a/php-fpm/Dockerfile b/php-fpm/Dockerfile index a36aaf5..58bbe47 100644 --- a/php-fpm/Dockerfile +++ b/php-fpm/Dockerfile @@ -70,6 +70,16 @@ RUN set -xe; \ # - INSTALL_SOAP=true # +########################################################################### +# BZ2: +########################################################################### + +ARG INSTALL_BZ2=false +RUN if [ ${INSTALL_BZ2} = true ]; then \ + apt-get -y install libbz2-dev; \ + docker-php-ext-install bz2 \ +;fi + ########################################################################### # SSH2: ########################################################################### diff --git a/php-worker/Dockerfile b/php-worker/Dockerfile index 388940e..f55ae45 100644 --- a/php-worker/Dockerfile +++ b/php-worker/Dockerfile @@ -46,6 +46,13 @@ ENV PGID ${PGID} RUN addgroup -g ${PGID} laradock && \ adduser -D -G laradock -u ${PUID} laradock +#Install BZ2: +ARG INSTALL_BZ2=false +RUN if [ ${INSTALL_BZ2} = true ]; then \ + apk --update add bzip2-dev; \ + docker-php-ext-install bz2; \ +fi + #Install SOAP package: ARG INSTALL_SOAP=false RUN if [ ${INSTALL_SOAP} = true ]; then \ diff --git a/workspace/Dockerfile b/workspace/Dockerfile index 0fa66a4..553e0ec 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -232,6 +232,15 @@ RUN if [ ${INSTALL_WP_CLI} = true ]; then \ chmod +x /usr/local/bin/wp \ ;fi +########################################################################### +# BZ2: +########################################################################### + +ARG INSTALL_BZ2=false +RUN if [ ${INSTALL_BZ2} = true ]; then \ + apt-get -y install php${LARADOCK_PHP_VERSION}-bz2 \ +;fi + ########################################################################### # SSH2: ########################################################################### From 53d13f23f7024a91f2470d8c7f72a40cc3d6f28e Mon Sep 17 00:00:00 2001 From: Shao Yu Lung Date: Wed, 12 Feb 2020 18:23:22 +0800 Subject: [PATCH 11/11] horizon gmp ext --- docker-compose.yml | 7 ++++--- env-example | 7 ++++--- laravel-horizon/Dockerfile | 7 +++++++ php-fpm/Dockerfile | 30 +++++++++++++++--------------- php-worker/Dockerfile | 14 +++++++------- workspace/Dockerfile | 28 ++++++++++++++-------------- 6 files changed, 51 insertions(+), 42 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 2270851..79c31cc 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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} @@ -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} @@ -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} @@ -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} @@ -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} @@ -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} diff --git a/env-example b/env-example index 0f7127d..e6cb581 100644 --- a/env-example +++ b/env-example @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/laravel-horizon/Dockerfile b/laravel-horizon/Dockerfile index 965cf26..e8ca7ab 100644 --- a/laravel-horizon/Dockerfile +++ b/laravel-horizon/Dockerfile @@ -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 \ diff --git a/php-fpm/Dockerfile b/php-fpm/Dockerfile index 58bbe47..b3246ed 100644 --- a/php-fpm/Dockerfile +++ b/php-fpm/Dockerfile @@ -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: ########################################################################### @@ -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: ########################################################################### diff --git a/php-worker/Dockerfile b/php-worker/Dockerfile index f55ae45..4717054 100644 --- a/php-worker/Dockerfile +++ b/php-worker/Dockerfile @@ -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 \ @@ -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 \ diff --git a/workspace/Dockerfile b/workspace/Dockerfile index 833eaea..267cc16 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -242,20 +242,7 @@ RUN if [ ${INSTALL_BZ2} = true ]; then \ ;fi ########################################################################### -# SSH2: -########################################################################### - -USER root - -ARG INSTALL_SSH2=false - -RUN if [ ${INSTALL_SSH2} = true ]; then \ - # Install the PHP SSH2 extension - apt-get -y install libssh2-1-dev php${LARADOCK_PHP_VERSION}-ssh2 \ -;fi - -########################################################################### -# GMP: +# GMP (GNU Multiple Precision): ########################################################################### USER root @@ -268,6 +255,19 @@ RUN if [ ${INSTALL_GMP} = true ]; then \ apt-get -y install php${LARADOCK_PHP_VERSION}-gmp \ ;fi +########################################################################### +# SSH2: +########################################################################### + +USER root + +ARG INSTALL_SSH2=false + +RUN if [ ${INSTALL_SSH2} = true ]; then \ + # Install the PHP SSH2 extension + apt-get -y install libssh2-1-dev php${LARADOCK_PHP_VERSION}-ssh2 \ +;fi + ########################################################################### # SOAP: ###########################################################################