From b28f44955681244da1a7b04c013a667ae68b825d Mon Sep 17 00:00:00 2001 From: Scott Collier Date: Mon, 20 Jan 2020 12:24:18 -0600 Subject: [PATCH 1/4] 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 14d5be03..d007bcac 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 7f1543fe..bb751284 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 feecbd65..256288da 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 6223e0a2..3bf68724 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 00000000..374e9fad --- /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 2/4] 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 256288da..a98d14b4 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 8b4391e63ca9260a29177d368fbf5eb7b494fd6f Mon Sep 17 00:00:00 2001 From: Saulo Paiva Date: Sat, 25 Jan 2020 11:23:48 -0300 Subject: [PATCH 3/4] 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 03bb15ca..870a5e46 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 53d13f23f7024a91f2470d8c7f72a40cc3d6f28e Mon Sep 17 00:00:00 2001 From: Shao Yu Lung Date: Wed, 12 Feb 2020 18:23:22 +0800 Subject: [PATCH 4/4] 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 22708518..79c31cc6 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 0f7127d4..e6cb581a 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 965cf261..e8ca7abd 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 58bbe47d..b3246ed9 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 f55ae45b..47170541 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 833eaeaf..267cc16d 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: ###########################################################################