From 5b33a2b319bfdaedfb97833f799d443fda7fe8b0 Mon Sep 17 00:00:00 2001 From: Valentino Lauciani Date: Tue, 4 Feb 2020 16:53:14 +0100 Subject: [PATCH 1/5] Add variable to install YAML extension --- docker-compose.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose.yml b/docker-compose.yml index dfc7a2e..d72ffd4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -287,6 +287,7 @@ services: - INSTALL_BCMATH=${PHP_FPM_INSTALL_BCMATH} - INSTALL_MEMCACHED=${PHP_FPM_INSTALL_MEMCACHED} - INSTALL_SOCKETS=${LARAVEL_HORIZON_INSTALL_SOCKETS} + - INSTALL_YAML=${LARAVEL_HORIZON_INSTALL_YAML} - INSTALL_CASSANDRA=${PHP_FPM_INSTALL_CASSANDRA} - INSTALL_PHPREDIS=${LARAVEL_HORIZON_INSTALL_PHPREDIS} - INSTALL_MONGO=${LARAVEL_HORIZON_INSTALL_MONGO} From c9e71c695ea38873dc12517d40a35935d9934286 Mon Sep 17 00:00:00 2001 From: Valentino Lauciani Date: Tue, 4 Feb 2020 16:55:50 +0100 Subject: [PATCH 2/5] Add variable to install YAML extension --- env-example | 1 + 1 file changed, 1 insertion(+) diff --git a/env-example b/env-example index 720f94b..e0ab228 100644 --- a/env-example +++ b/env-example @@ -251,6 +251,7 @@ NGINX_SSL_PATH=./nginx/ssl/ ### LARAVEL_HORIZON ################################################ LARAVEL_HORIZON_INSTALL_SOCKETS=false +LARAVEL_HORIZON_INSTALL_YAML=false LARAVEL_HORIZON_INSTALL_PHPREDIS=true LARAVEL_HORIZON_INSTALL_MONGO=false LARAVEL_HORIZON_INSTALL_FFMPEG=false From 82a4b1db60f0aff8e97c61e843ee90a47a814c82 Mon Sep 17 00:00:00 2001 From: Valentino Lauciani Date: Tue, 4 Feb 2020 16:57:14 +0100 Subject: [PATCH 3/5] Add code to install YAML extension --- laravel-horizon/Dockerfile | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/laravel-horizon/Dockerfile b/laravel-horizon/Dockerfile index 05a8ef2..c6cfada 100644 --- a/laravel-horizon/Dockerfile +++ b/laravel-horizon/Dockerfile @@ -105,6 +105,23 @@ RUN if [ ${INSTALL_MONGO} = true ]; then \ && docker-php-ext-enable mongodb \ ;fi +########################################################################### + # YAML: extension + ########################################################################### + + ARG INSTALL_YAML=false + + RUN if [ ${INSTALL_YAML} = true ]; then \ + apt-get install libyaml-dev -y ; \ + if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \ + pecl install -a yaml-1.3.2; \ + else \ + pecl install yaml; \ + fi && \ + echo "extension=yaml.so" >> /etc/php/${LARADOCK_PHP_VERSION}/mods-available/yaml.ini && \ + ln -s /etc/php/${LARADOCK_PHP_VERSION}/mods-available/yaml.ini /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/35-yaml.ini \ + ;fi + ########################################################################### # PHP Memcached: From 72d11e4485b4d2e014ff97201aa03ac10be241b1 Mon Sep 17 00:00:00 2001 From: Valentino Lauciani Date: Tue, 4 Feb 2020 17:00:01 +0100 Subject: [PATCH 4/5] fix indentations --- laravel-horizon/Dockerfile | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/laravel-horizon/Dockerfile b/laravel-horizon/Dockerfile index c6cfada..07a8f8d 100644 --- a/laravel-horizon/Dockerfile +++ b/laravel-horizon/Dockerfile @@ -106,21 +106,21 @@ RUN if [ ${INSTALL_MONGO} = true ]; then \ ;fi ########################################################################### - # YAML: extension - ########################################################################### +# YAML: extension +########################################################################### - ARG INSTALL_YAML=false +ARG INSTALL_YAML=false - RUN if [ ${INSTALL_YAML} = true ]; then \ - apt-get install libyaml-dev -y ; \ - if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \ - pecl install -a yaml-1.3.2; \ - else \ - pecl install yaml; \ - fi && \ - echo "extension=yaml.so" >> /etc/php/${LARADOCK_PHP_VERSION}/mods-available/yaml.ini && \ - ln -s /etc/php/${LARADOCK_PHP_VERSION}/mods-available/yaml.ini /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/35-yaml.ini \ - ;fi +RUN if [ ${INSTALL_YAML} = true ]; then \ + apt-get install libyaml-dev -y ; \ + if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \ + pecl install -a yaml-1.3.2; \ + else \ + pecl install yaml; \ + fi && \ + echo "extension=yaml.so" >> /etc/php/${LARADOCK_PHP_VERSION}/mods-available/yaml.ini && \ + ln -s /etc/php/${LARADOCK_PHP_VERSION}/mods-available/yaml.ini /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/35-yaml.ini \ +;fi ########################################################################### From 0a253a3d7e464c967c4b9cb179a4571ef07a2ebc Mon Sep 17 00:00:00 2001 From: Valentino Lauciani Date: Tue, 4 Feb 2020 20:33:41 +0100 Subject: [PATCH 5/5] Alpine commands used --- laravel-horizon/Dockerfile | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/laravel-horizon/Dockerfile b/laravel-horizon/Dockerfile index 07a8f8d..49d0495 100644 --- a/laravel-horizon/Dockerfile +++ b/laravel-horizon/Dockerfile @@ -106,20 +106,21 @@ RUN if [ ${INSTALL_MONGO} = true ]; then \ ;fi ########################################################################### -# YAML: extension +# YAML: extension ########################################################################### ARG INSTALL_YAML=false - + RUN if [ ${INSTALL_YAML} = true ]; then \ - apt-get install libyaml-dev -y ; \ - if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \ - pecl install -a yaml-1.3.2; \ - else \ - pecl install yaml; \ - fi && \ - echo "extension=yaml.so" >> /etc/php/${LARADOCK_PHP_VERSION}/mods-available/yaml.ini && \ - ln -s /etc/php/${LARADOCK_PHP_VERSION}/mods-available/yaml.ini /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/35-yaml.ini \ + apk --update add -U --no-cache --virtual temp yaml-dev \ + && apk add --no-cache yaml \ + && docker-php-source extract \ + && pecl channel-update pecl.php.net \ + && pecl install yaml \ + && docker-php-ext-enable yaml \ + && pecl clear-cache \ + && docker-php-source delete \ + && apk del temp \ ;fi