From 3f08a762f5c8076f4b440a5bf13b4eb085b33168 Mon Sep 17 00:00:00 2001 From: cytopia Date: Mon, 24 Dec 2018 12:19:42 +0100 Subject: [PATCH 1/5] Use Docker VOLUME sections only where applicable --- Dockerfiles/prod/Dockerfile-5.2 | 3 --- Dockerfiles/prod/Dockerfile-5.3 | 3 --- Dockerfiles/prod/Dockerfile-5.4 | 3 --- Dockerfiles/prod/Dockerfile-5.5 | 3 --- Dockerfiles/prod/Dockerfile-5.6 | 3 --- Dockerfiles/prod/Dockerfile-7.0 | 3 --- Dockerfiles/prod/Dockerfile-7.1 | 3 --- Dockerfiles/prod/Dockerfile-7.2 | 3 --- Dockerfiles/prod/Dockerfile-7.3 | 3 --- Dockerfiles/prod/Dockerfile-7.4 | 3 --- Dockerfiles/work/Dockerfile-5.2 | 4 ---- Dockerfiles/work/Dockerfile-5.3 | 4 ---- Dockerfiles/work/Dockerfile-5.4 | 4 ---- Dockerfiles/work/Dockerfile-5.5 | 4 ---- Dockerfiles/work/Dockerfile-5.6 | 4 ---- Dockerfiles/work/Dockerfile-7.0 | 4 ---- Dockerfiles/work/Dockerfile-7.1 | 4 ---- Dockerfiles/work/Dockerfile-7.2 | 4 ---- Dockerfiles/work/Dockerfile-7.3 | 4 ---- Dockerfiles/work/Dockerfile-7.4 | 4 ---- build/ansible/DOCKERFILES/Dockerfile-prod.j2 | 3 --- build/ansible/DOCKERFILES/Dockerfile-work.j2 | 4 ---- 22 files changed, 77 deletions(-) diff --git a/Dockerfiles/prod/Dockerfile-5.2 b/Dockerfiles/prod/Dockerfile-5.2 index 4e307076..b172931c 100644 --- a/Dockerfiles/prod/Dockerfile-5.2 +++ b/Dockerfiles/prod/Dockerfile-5.2 @@ -72,9 +72,6 @@ COPY ./data/supervisord.conf /etc/supervisor/supervisord.conf ### ### Volumes ### -VOLUME /etc/php-custom.d -VOLUME /etc/php-fpm-custom.d -VOLUME /etc/php-modules.d VOLUME /var/log/php VOLUME /var/mail diff --git a/Dockerfiles/prod/Dockerfile-5.3 b/Dockerfiles/prod/Dockerfile-5.3 index 632c8480..75aa343e 100644 --- a/Dockerfiles/prod/Dockerfile-5.3 +++ b/Dockerfiles/prod/Dockerfile-5.3 @@ -72,9 +72,6 @@ COPY ./data/supervisord.conf /etc/supervisor/supervisord.conf ### ### Volumes ### -VOLUME /etc/php-custom.d -VOLUME /etc/php-fpm-custom.d -VOLUME /etc/php-modules.d VOLUME /var/log/php VOLUME /var/mail diff --git a/Dockerfiles/prod/Dockerfile-5.4 b/Dockerfiles/prod/Dockerfile-5.4 index 5aac5d84..78c6b13a 100644 --- a/Dockerfiles/prod/Dockerfile-5.4 +++ b/Dockerfiles/prod/Dockerfile-5.4 @@ -72,9 +72,6 @@ COPY ./data/supervisord.conf /etc/supervisor/supervisord.conf ### ### Volumes ### -VOLUME /etc/php-custom.d -VOLUME /etc/php-fpm-custom.d -VOLUME /etc/php-modules.d VOLUME /var/log/php VOLUME /var/mail diff --git a/Dockerfiles/prod/Dockerfile-5.5 b/Dockerfiles/prod/Dockerfile-5.5 index 6d21f47f..6119145a 100644 --- a/Dockerfiles/prod/Dockerfile-5.5 +++ b/Dockerfiles/prod/Dockerfile-5.5 @@ -72,9 +72,6 @@ COPY ./data/supervisord.conf /etc/supervisor/supervisord.conf ### ### Volumes ### -VOLUME /etc/php-custom.d -VOLUME /etc/php-fpm-custom.d -VOLUME /etc/php-modules.d VOLUME /var/log/php VOLUME /var/mail diff --git a/Dockerfiles/prod/Dockerfile-5.6 b/Dockerfiles/prod/Dockerfile-5.6 index 32927d9a..f28b418c 100644 --- a/Dockerfiles/prod/Dockerfile-5.6 +++ b/Dockerfiles/prod/Dockerfile-5.6 @@ -72,9 +72,6 @@ COPY ./data/supervisord.conf /etc/supervisor/supervisord.conf ### ### Volumes ### -VOLUME /etc/php-custom.d -VOLUME /etc/php-fpm-custom.d -VOLUME /etc/php-modules.d VOLUME /var/log/php VOLUME /var/mail diff --git a/Dockerfiles/prod/Dockerfile-7.0 b/Dockerfiles/prod/Dockerfile-7.0 index cfd1d081..b22b6060 100644 --- a/Dockerfiles/prod/Dockerfile-7.0 +++ b/Dockerfiles/prod/Dockerfile-7.0 @@ -72,9 +72,6 @@ COPY ./data/supervisord.conf /etc/supervisor/supervisord.conf ### ### Volumes ### -VOLUME /etc/php-custom.d -VOLUME /etc/php-fpm-custom.d -VOLUME /etc/php-modules.d VOLUME /var/log/php VOLUME /var/mail diff --git a/Dockerfiles/prod/Dockerfile-7.1 b/Dockerfiles/prod/Dockerfile-7.1 index badd9f03..ce8f18e9 100644 --- a/Dockerfiles/prod/Dockerfile-7.1 +++ b/Dockerfiles/prod/Dockerfile-7.1 @@ -72,9 +72,6 @@ COPY ./data/supervisord.conf /etc/supervisor/supervisord.conf ### ### Volumes ### -VOLUME /etc/php-custom.d -VOLUME /etc/php-fpm-custom.d -VOLUME /etc/php-modules.d VOLUME /var/log/php VOLUME /var/mail diff --git a/Dockerfiles/prod/Dockerfile-7.2 b/Dockerfiles/prod/Dockerfile-7.2 index 37de975f..a669405d 100644 --- a/Dockerfiles/prod/Dockerfile-7.2 +++ b/Dockerfiles/prod/Dockerfile-7.2 @@ -72,9 +72,6 @@ COPY ./data/supervisord.conf /etc/supervisor/supervisord.conf ### ### Volumes ### -VOLUME /etc/php-custom.d -VOLUME /etc/php-fpm-custom.d -VOLUME /etc/php-modules.d VOLUME /var/log/php VOLUME /var/mail diff --git a/Dockerfiles/prod/Dockerfile-7.3 b/Dockerfiles/prod/Dockerfile-7.3 index 83f108b9..4d187308 100644 --- a/Dockerfiles/prod/Dockerfile-7.3 +++ b/Dockerfiles/prod/Dockerfile-7.3 @@ -72,9 +72,6 @@ COPY ./data/supervisord.conf /etc/supervisor/supervisord.conf ### ### Volumes ### -VOLUME /etc/php-custom.d -VOLUME /etc/php-fpm-custom.d -VOLUME /etc/php-modules.d VOLUME /var/log/php VOLUME /var/mail diff --git a/Dockerfiles/prod/Dockerfile-7.4 b/Dockerfiles/prod/Dockerfile-7.4 index 0cace179..cae332c2 100644 --- a/Dockerfiles/prod/Dockerfile-7.4 +++ b/Dockerfiles/prod/Dockerfile-7.4 @@ -72,9 +72,6 @@ COPY ./data/supervisord.conf /etc/supervisor/supervisord.conf ### ### Volumes ### -VOLUME /etc/php-custom.d -VOLUME /etc/php-fpm-custom.d -VOLUME /etc/php-modules.d VOLUME /var/log/php VOLUME /var/mail diff --git a/Dockerfiles/work/Dockerfile-5.2 b/Dockerfiles/work/Dockerfile-5.2 index ad3a0d38..3f4e3bee 100644 --- a/Dockerfiles/work/Dockerfile-5.2 +++ b/Dockerfiles/work/Dockerfile-5.2 @@ -328,10 +328,6 @@ COPY ./data/sudo-devilbox /etc/sudoers.d/devilbox ### ### Volumes ### -VOLUME /etc/bashrc-devilbox.d -VOLUME /etc/php-custom.d -VOLUME /etc/php-fpm-custom.d -VOLUME /etc/php-modules.d VOLUME /shared/backups VOLUME /var/log/php VOLUME /var/mail diff --git a/Dockerfiles/work/Dockerfile-5.3 b/Dockerfiles/work/Dockerfile-5.3 index 872ba7c0..64af1ce7 100644 --- a/Dockerfiles/work/Dockerfile-5.3 +++ b/Dockerfiles/work/Dockerfile-5.3 @@ -371,10 +371,6 @@ COPY ./data/sudo-devilbox /etc/sudoers.d/devilbox ### ### Volumes ### -VOLUME /etc/bashrc-devilbox.d -VOLUME /etc/php-custom.d -VOLUME /etc/php-fpm-custom.d -VOLUME /etc/php-modules.d VOLUME /shared/backups VOLUME /var/log/php VOLUME /var/mail diff --git a/Dockerfiles/work/Dockerfile-5.4 b/Dockerfiles/work/Dockerfile-5.4 index 1b3b6612..b4995206 100644 --- a/Dockerfiles/work/Dockerfile-5.4 +++ b/Dockerfiles/work/Dockerfile-5.4 @@ -404,10 +404,6 @@ COPY ./data/sudo-devilbox /etc/sudoers.d/devilbox ### ### Volumes ### -VOLUME /etc/bashrc-devilbox.d -VOLUME /etc/php-custom.d -VOLUME /etc/php-fpm-custom.d -VOLUME /etc/php-modules.d VOLUME /shared/backups VOLUME /var/log/php VOLUME /var/mail diff --git a/Dockerfiles/work/Dockerfile-5.5 b/Dockerfiles/work/Dockerfile-5.5 index 9f559dc3..29191dfc 100644 --- a/Dockerfiles/work/Dockerfile-5.5 +++ b/Dockerfiles/work/Dockerfile-5.5 @@ -418,10 +418,6 @@ COPY ./data/sudo-devilbox /etc/sudoers.d/devilbox ### ### Volumes ### -VOLUME /etc/bashrc-devilbox.d -VOLUME /etc/php-custom.d -VOLUME /etc/php-fpm-custom.d -VOLUME /etc/php-modules.d VOLUME /shared/backups VOLUME /var/log/php VOLUME /var/mail diff --git a/Dockerfiles/work/Dockerfile-5.6 b/Dockerfiles/work/Dockerfile-5.6 index bd96cc50..61a8d28c 100644 --- a/Dockerfiles/work/Dockerfile-5.6 +++ b/Dockerfiles/work/Dockerfile-5.6 @@ -432,10 +432,6 @@ COPY ./data/sudo-devilbox /etc/sudoers.d/devilbox ### ### Volumes ### -VOLUME /etc/bashrc-devilbox.d -VOLUME /etc/php-custom.d -VOLUME /etc/php-fpm-custom.d -VOLUME /etc/php-modules.d VOLUME /shared/backups VOLUME /var/log/php VOLUME /var/mail diff --git a/Dockerfiles/work/Dockerfile-7.0 b/Dockerfiles/work/Dockerfile-7.0 index 914662da..d1429a9c 100644 --- a/Dockerfiles/work/Dockerfile-7.0 +++ b/Dockerfiles/work/Dockerfile-7.0 @@ -432,10 +432,6 @@ COPY ./data/sudo-devilbox /etc/sudoers.d/devilbox ### ### Volumes ### -VOLUME /etc/bashrc-devilbox.d -VOLUME /etc/php-custom.d -VOLUME /etc/php-fpm-custom.d -VOLUME /etc/php-modules.d VOLUME /shared/backups VOLUME /var/log/php VOLUME /var/mail diff --git a/Dockerfiles/work/Dockerfile-7.1 b/Dockerfiles/work/Dockerfile-7.1 index 4660996a..9158f495 100644 --- a/Dockerfiles/work/Dockerfile-7.1 +++ b/Dockerfiles/work/Dockerfile-7.1 @@ -432,10 +432,6 @@ COPY ./data/sudo-devilbox /etc/sudoers.d/devilbox ### ### Volumes ### -VOLUME /etc/bashrc-devilbox.d -VOLUME /etc/php-custom.d -VOLUME /etc/php-fpm-custom.d -VOLUME /etc/php-modules.d VOLUME /shared/backups VOLUME /var/log/php VOLUME /var/mail diff --git a/Dockerfiles/work/Dockerfile-7.2 b/Dockerfiles/work/Dockerfile-7.2 index ea0b1cfd..63ed8635 100644 --- a/Dockerfiles/work/Dockerfile-7.2 +++ b/Dockerfiles/work/Dockerfile-7.2 @@ -432,10 +432,6 @@ COPY ./data/sudo-devilbox /etc/sudoers.d/devilbox ### ### Volumes ### -VOLUME /etc/bashrc-devilbox.d -VOLUME /etc/php-custom.d -VOLUME /etc/php-fpm-custom.d -VOLUME /etc/php-modules.d VOLUME /shared/backups VOLUME /var/log/php VOLUME /var/mail diff --git a/Dockerfiles/work/Dockerfile-7.3 b/Dockerfiles/work/Dockerfile-7.3 index c98b19ca..c812fe5c 100644 --- a/Dockerfiles/work/Dockerfile-7.3 +++ b/Dockerfiles/work/Dockerfile-7.3 @@ -420,10 +420,6 @@ COPY ./data/sudo-devilbox /etc/sudoers.d/devilbox ### ### Volumes ### -VOLUME /etc/bashrc-devilbox.d -VOLUME /etc/php-custom.d -VOLUME /etc/php-fpm-custom.d -VOLUME /etc/php-modules.d VOLUME /shared/backups VOLUME /var/log/php VOLUME /var/mail diff --git a/Dockerfiles/work/Dockerfile-7.4 b/Dockerfiles/work/Dockerfile-7.4 index 15713a27..64e52533 100644 --- a/Dockerfiles/work/Dockerfile-7.4 +++ b/Dockerfiles/work/Dockerfile-7.4 @@ -420,10 +420,6 @@ COPY ./data/sudo-devilbox /etc/sudoers.d/devilbox ### ### Volumes ### -VOLUME /etc/bashrc-devilbox.d -VOLUME /etc/php-custom.d -VOLUME /etc/php-fpm-custom.d -VOLUME /etc/php-modules.d VOLUME /shared/backups VOLUME /var/log/php VOLUME /var/mail diff --git a/build/ansible/DOCKERFILES/Dockerfile-prod.j2 b/build/ansible/DOCKERFILES/Dockerfile-prod.j2 index 639fe99e..939694e9 100644 --- a/build/ansible/DOCKERFILES/Dockerfile-prod.j2 +++ b/build/ansible/DOCKERFILES/Dockerfile-prod.j2 @@ -74,9 +74,6 @@ COPY ./data/supervisord.conf /etc/supervisor/supervisord.conf ### ### Volumes ### -VOLUME /etc/php-custom.d -VOLUME /etc/php-fpm-custom.d -VOLUME /etc/php-modules.d VOLUME /var/log/php VOLUME /var/mail diff --git a/build/ansible/DOCKERFILES/Dockerfile-work.j2 b/build/ansible/DOCKERFILES/Dockerfile-work.j2 index 6e1be437..475f4a13 100644 --- a/build/ansible/DOCKERFILES/Dockerfile-work.j2 +++ b/build/ansible/DOCKERFILES/Dockerfile-work.j2 @@ -246,10 +246,6 @@ COPY ./data/sudo-devilbox /etc/sudoers.d/devilbox ### ### Volumes ### -VOLUME /etc/bashrc-devilbox.d -VOLUME /etc/php-custom.d -VOLUME /etc/php-fpm-custom.d -VOLUME /etc/php-modules.d VOLUME /shared/backups VOLUME /var/log/php VOLUME /var/mail From 4f1a054f8cb684329817236655bb2598031ccc92 Mon Sep 17 00:00:00 2001 From: cytopia Date: Mon, 24 Dec 2018 13:12:19 +0100 Subject: [PATCH 2/5] Renamed entrypoint scripts to allow for more --- .../docker-entrypoint.d/{00-base-libs.sh => 100-base-libs.sh} | 0 .../data/docker-entrypoint.d/{01-uid-gid.sh => 101-uid-gid.sh} | 0 .../data/docker-entrypoint.d/{30-timezone.sh => 300-timezone.sh} | 0 .../data/docker-entrypoint.d/{31-postfix.sh => 301-postfix.sh} | 0 .../docker-entrypoint.d/{32-docker-logs.sh => 302-docker-logs.sh} | 0 .../{33-socat-port-forwarding.sh => 303-socat-port-forwarding.sh} | 0 .../docker-entrypoint.d/{34-supervisor.sh => 304-supervisor.sh} | 0 .../{35-custom-ini-files.sh => 305-custom-ini-files.sh} | 0 .../{36-custom-php-fpm-files.sh => 306-custom-php-fpm-files.sh} | 0 .../{37-fix-php-5.3-env-vars.sh => 307-fix-php-5.3-env-vars.sh} | 0 .../{38-enable-modules.sh => 308-enable-modules.sh} | 0 .../{39-disable-modules.sh => 309-disable-modules.sh} | 0 .../{40-mysqldump-secure.sh => 400-mysqldump-secure.sh} | 0 ...41-update-ca-certificates.sh => 401-update-ca-certificates.sh} | 0 14 files changed, 0 insertions(+), 0 deletions(-) rename Dockerfiles/base/data/docker-entrypoint.d/{00-base-libs.sh => 100-base-libs.sh} (100%) rename Dockerfiles/base/data/docker-entrypoint.d/{01-uid-gid.sh => 101-uid-gid.sh} (100%) rename Dockerfiles/prod/data/docker-entrypoint.d/{30-timezone.sh => 300-timezone.sh} (100%) rename Dockerfiles/prod/data/docker-entrypoint.d/{31-postfix.sh => 301-postfix.sh} (100%) rename Dockerfiles/prod/data/docker-entrypoint.d/{32-docker-logs.sh => 302-docker-logs.sh} (100%) rename Dockerfiles/prod/data/docker-entrypoint.d/{33-socat-port-forwarding.sh => 303-socat-port-forwarding.sh} (100%) rename Dockerfiles/prod/data/docker-entrypoint.d/{34-supervisor.sh => 304-supervisor.sh} (100%) rename Dockerfiles/prod/data/docker-entrypoint.d/{35-custom-ini-files.sh => 305-custom-ini-files.sh} (100%) rename Dockerfiles/prod/data/docker-entrypoint.d/{36-custom-php-fpm-files.sh => 306-custom-php-fpm-files.sh} (100%) rename Dockerfiles/prod/data/docker-entrypoint.d/{37-fix-php-5.3-env-vars.sh => 307-fix-php-5.3-env-vars.sh} (100%) rename Dockerfiles/prod/data/docker-entrypoint.d/{38-enable-modules.sh => 308-enable-modules.sh} (100%) rename Dockerfiles/prod/data/docker-entrypoint.d/{39-disable-modules.sh => 309-disable-modules.sh} (100%) rename Dockerfiles/work/data/docker-entrypoint.d/{40-mysqldump-secure.sh => 400-mysqldump-secure.sh} (100%) rename Dockerfiles/work/data/docker-entrypoint.d/{41-update-ca-certificates.sh => 401-update-ca-certificates.sh} (100%) diff --git a/Dockerfiles/base/data/docker-entrypoint.d/00-base-libs.sh b/Dockerfiles/base/data/docker-entrypoint.d/100-base-libs.sh similarity index 100% rename from Dockerfiles/base/data/docker-entrypoint.d/00-base-libs.sh rename to Dockerfiles/base/data/docker-entrypoint.d/100-base-libs.sh diff --git a/Dockerfiles/base/data/docker-entrypoint.d/01-uid-gid.sh b/Dockerfiles/base/data/docker-entrypoint.d/101-uid-gid.sh similarity index 100% rename from Dockerfiles/base/data/docker-entrypoint.d/01-uid-gid.sh rename to Dockerfiles/base/data/docker-entrypoint.d/101-uid-gid.sh diff --git a/Dockerfiles/prod/data/docker-entrypoint.d/30-timezone.sh b/Dockerfiles/prod/data/docker-entrypoint.d/300-timezone.sh similarity index 100% rename from Dockerfiles/prod/data/docker-entrypoint.d/30-timezone.sh rename to Dockerfiles/prod/data/docker-entrypoint.d/300-timezone.sh diff --git a/Dockerfiles/prod/data/docker-entrypoint.d/31-postfix.sh b/Dockerfiles/prod/data/docker-entrypoint.d/301-postfix.sh similarity index 100% rename from Dockerfiles/prod/data/docker-entrypoint.d/31-postfix.sh rename to Dockerfiles/prod/data/docker-entrypoint.d/301-postfix.sh diff --git a/Dockerfiles/prod/data/docker-entrypoint.d/32-docker-logs.sh b/Dockerfiles/prod/data/docker-entrypoint.d/302-docker-logs.sh similarity index 100% rename from Dockerfiles/prod/data/docker-entrypoint.d/32-docker-logs.sh rename to Dockerfiles/prod/data/docker-entrypoint.d/302-docker-logs.sh diff --git a/Dockerfiles/prod/data/docker-entrypoint.d/33-socat-port-forwarding.sh b/Dockerfiles/prod/data/docker-entrypoint.d/303-socat-port-forwarding.sh similarity index 100% rename from Dockerfiles/prod/data/docker-entrypoint.d/33-socat-port-forwarding.sh rename to Dockerfiles/prod/data/docker-entrypoint.d/303-socat-port-forwarding.sh diff --git a/Dockerfiles/prod/data/docker-entrypoint.d/34-supervisor.sh b/Dockerfiles/prod/data/docker-entrypoint.d/304-supervisor.sh similarity index 100% rename from Dockerfiles/prod/data/docker-entrypoint.d/34-supervisor.sh rename to Dockerfiles/prod/data/docker-entrypoint.d/304-supervisor.sh diff --git a/Dockerfiles/prod/data/docker-entrypoint.d/35-custom-ini-files.sh b/Dockerfiles/prod/data/docker-entrypoint.d/305-custom-ini-files.sh similarity index 100% rename from Dockerfiles/prod/data/docker-entrypoint.d/35-custom-ini-files.sh rename to Dockerfiles/prod/data/docker-entrypoint.d/305-custom-ini-files.sh diff --git a/Dockerfiles/prod/data/docker-entrypoint.d/36-custom-php-fpm-files.sh b/Dockerfiles/prod/data/docker-entrypoint.d/306-custom-php-fpm-files.sh similarity index 100% rename from Dockerfiles/prod/data/docker-entrypoint.d/36-custom-php-fpm-files.sh rename to Dockerfiles/prod/data/docker-entrypoint.d/306-custom-php-fpm-files.sh diff --git a/Dockerfiles/prod/data/docker-entrypoint.d/37-fix-php-5.3-env-vars.sh b/Dockerfiles/prod/data/docker-entrypoint.d/307-fix-php-5.3-env-vars.sh similarity index 100% rename from Dockerfiles/prod/data/docker-entrypoint.d/37-fix-php-5.3-env-vars.sh rename to Dockerfiles/prod/data/docker-entrypoint.d/307-fix-php-5.3-env-vars.sh diff --git a/Dockerfiles/prod/data/docker-entrypoint.d/38-enable-modules.sh b/Dockerfiles/prod/data/docker-entrypoint.d/308-enable-modules.sh similarity index 100% rename from Dockerfiles/prod/data/docker-entrypoint.d/38-enable-modules.sh rename to Dockerfiles/prod/data/docker-entrypoint.d/308-enable-modules.sh diff --git a/Dockerfiles/prod/data/docker-entrypoint.d/39-disable-modules.sh b/Dockerfiles/prod/data/docker-entrypoint.d/309-disable-modules.sh similarity index 100% rename from Dockerfiles/prod/data/docker-entrypoint.d/39-disable-modules.sh rename to Dockerfiles/prod/data/docker-entrypoint.d/309-disable-modules.sh diff --git a/Dockerfiles/work/data/docker-entrypoint.d/40-mysqldump-secure.sh b/Dockerfiles/work/data/docker-entrypoint.d/400-mysqldump-secure.sh similarity index 100% rename from Dockerfiles/work/data/docker-entrypoint.d/40-mysqldump-secure.sh rename to Dockerfiles/work/data/docker-entrypoint.d/400-mysqldump-secure.sh diff --git a/Dockerfiles/work/data/docker-entrypoint.d/41-update-ca-certificates.sh b/Dockerfiles/work/data/docker-entrypoint.d/401-update-ca-certificates.sh similarity index 100% rename from Dockerfiles/work/data/docker-entrypoint.d/41-update-ca-certificates.sh rename to Dockerfiles/work/data/docker-entrypoint.d/401-update-ca-certificates.sh From 023ad2af601024879e4d67796b74b176a6e0152f Mon Sep 17 00:00:00 2001 From: cytopia Date: Mon, 24 Dec 2018 13:20:52 +0100 Subject: [PATCH 3/5] Allow for custom user-supplied startup scripts --- .../310-custom-startup-scripts.sh | 49 +++++++++++++++++++ Dockerfiles/prod/data/docker-entrypoint.sh | 7 +++ Dockerfiles/work/data/docker-entrypoint.sh | 6 +++ README.md | 6 ++- 4 files changed, 67 insertions(+), 1 deletion(-) create mode 100755 Dockerfiles/prod/data/docker-entrypoint.d/310-custom-startup-scripts.sh diff --git a/Dockerfiles/prod/data/docker-entrypoint.d/310-custom-startup-scripts.sh b/Dockerfiles/prod/data/docker-entrypoint.d/310-custom-startup-scripts.sh new file mode 100755 index 00000000..49d251b4 --- /dev/null +++ b/Dockerfiles/prod/data/docker-entrypoint.d/310-custom-startup-scripts.sh @@ -0,0 +1,49 @@ +#!/usr/bin/env bash + +set -e +set -u +set -o pipefail + + +############################################################ +# Functions +############################################################ + +### +### Execute custom uesr-supplied scripts +### +execute_custom_scripts() { + local script_dir="${1}" + local debug="${2}" + + if [ ! -d "${script_dir}" ]; then + run "mkdir -p ${script_dir}" "${debug}" + fi + script_files="$( find "${script_dir}" -type f -iname '*.sh' )" + + # loop over them line by line + IFS=' + ' + for script_f in ${script_files}; do + script_name="$( basename "${script_f}" )" + log "info" "Executing custom startup script: ${script_name}" "${debug}" + if ! bash "${script_f}"; then + log "err" "Failed to execute script" "${debug}" + exit 1 + fi + done +} + + +############################################################ +# Sanity Checks +############################################################ + +if ! command -v find >/dev/null 2>&1; then + echo "find not found, but required." + exit 1 +fi +if ! command -v basename >/dev/null 2>&1; then + echo "basename not found, but required." + exit 1 +fi diff --git a/Dockerfiles/prod/data/docker-entrypoint.sh b/Dockerfiles/prod/data/docker-entrypoint.sh index 970820d9..4f9f669d 100755 --- a/Dockerfiles/prod/data/docker-entrypoint.sh +++ b/Dockerfiles/prod/data/docker-entrypoint.sh @@ -178,6 +178,13 @@ enable_modules "ENABLE_MODULES" "${DEBUG_LEVEL}" disable_modules "DISABLE_MODULES" "${DEBUG_LEVEL}" +### +### Run custom user supplied scripts +### +execute_custom_scripts "/startup.d" "${DEBUG_LEVEL}" + + +### ### ### Startup ### diff --git a/Dockerfiles/work/data/docker-entrypoint.sh b/Dockerfiles/work/data/docker-entrypoint.sh index afe08bd3..f1c1a49b 100755 --- a/Dockerfiles/work/data/docker-entrypoint.sh +++ b/Dockerfiles/work/data/docker-entrypoint.sh @@ -206,6 +206,12 @@ run "chmod 0755 /shared/httpd" "${DEBUG_LEVEL}" update_ca_certificates "/ca" "${DEBUG_LEVEL}" +### +### Run custom user supplied scripts +### +execute_custom_scripts "/startup.d" "${DEBUG_LEVEL}" + + ### ### Startup ### diff --git a/README.md b/README.md index 3a889f86..40e5b3d2 100644 --- a/README.md +++ b/README.md @@ -760,7 +760,7 @@ Have a look at the following table to see all offered volumes for each Docker im - prod

work + prod

work /etc/php-custom.d Mount this directory into your host computer and add custom \*.ini files in order to alter php behaviour. @@ -772,6 +772,10 @@ Have a look at the following table to see all offered volumes for each Docker im /etc/php-modules.d Mount this directory into your host computer and add custo \*.so files in order to add your php modules.

Note:Your should then also provide a custom \*.ini file in order to actually load your custom provided module. + + /startup.d + Any executable scripts ending by \*.sh found in this directory will be executed during startup. This is useful to supply additional commands (such as installing custom software) when the container starts up. + /var/log/php When setting environment variable DOCKER_LOGS to 0, log files will be available under this directory. From 70764c268cb069c567a3bf0f08077202929b807c Mon Sep 17 00:00:00 2001 From: cytopia Date: Mon, 24 Dec 2018 13:46:58 +0100 Subject: [PATCH 4/5] Add tests for custom startup scripts --- tests/prod/08-test-custom-user-scripts.sh | 62 +++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100755 tests/prod/08-test-custom-user-scripts.sh diff --git a/tests/prod/08-test-custom-user-scripts.sh b/tests/prod/08-test-custom-user-scripts.sh new file mode 100755 index 00000000..63f70175 --- /dev/null +++ b/tests/prod/08-test-custom-user-scripts.sh @@ -0,0 +1,62 @@ +#!/usr/bin/env bash + +set -e +set -u +set -o pipefail + +CWD="$(cd -P -- "$(dirname -- "$0")" && pwd -P)" + +IMAGE="${1}" +VERSION="${2}" +FLAVOUR="${3}" + +# shellcheck disable=SC1090 +. "${CWD}/../.lib.sh" + + + +############################################################ +# Tests +############################################################ + +### +### Check if PHP still starts up with working scripts +### +RUN_SH_HOST="$( mktemp -d )" +RUN_SH_CONT="/startup.d" + +# Fix mount permissions +chmod 0777 "${RUN_SH_HOST}" + +# Add a startup script to execute +printf "#!/bin/bash\\necho 'abcdefghijklmnopq';\\n" > "${RUN_SH_HOST}/myscript1.sh" +chmod +x "${RUN_SH_HOST}/myscript1.sh" + +# Start PHP-FPM +did="$( docker_run "${IMAGE}:${VERSION}-${FLAVOUR}" "-e DEBUG_ENTRYPOINT=2 -e NEW_UID=$(id -u) -e NEW_GID=$(id -g) -v ${RUN_SH_HOST}:${RUN_SH_CONT}" )" + +# Wait for both containers to be up and running +run "sleep 10" + +# Check entrypoint for script run +if ! run "docker logs ${did} | grep 'myscript1.sh'"; then + docker_logs "${did}" || true + docker_stop "${did}" || true + rm -rf "${RUN_SH_HOST}" + echo "Failed" + exit 1 +fi + +# Check entrypoint for script output +if ! run "docker logs ${did} | grep 'abcdefghijklmnopq'"; then + docker_logs "${did}" || true + docker_stop "${did}" || true + rm -rf "${RUN_SH_HOST}" + echo "Failed" + exit 1 +fi + + +# Cleanup +docker_stop "${did}" +rm -rf "${RUN_SH_HOST}" From 85991d2e3f8344cfa04dee1cda1e8de4520c4113 Mon Sep 17 00:00:00 2001 From: cytopia Date: Mon, 24 Dec 2018 13:58:30 +0100 Subject: [PATCH 5/5] Adding 'cron' binary --- Dockerfiles/prod/Dockerfile-5.2 | 1 + Dockerfiles/prod/Dockerfile-5.3 | 1 + Dockerfiles/prod/Dockerfile-5.4 | 1 + Dockerfiles/prod/Dockerfile-5.5 | 1 + Dockerfiles/prod/Dockerfile-5.6 | 1 + Dockerfiles/prod/Dockerfile-7.0 | 1 + Dockerfiles/prod/Dockerfile-7.1 | 1 + Dockerfiles/prod/Dockerfile-7.2 | 1 + Dockerfiles/prod/Dockerfile-7.3 | 1 + Dockerfiles/prod/Dockerfile-7.4 | 1 + build/ansible/DOCKERFILES/Dockerfile-prod.j2 | 1 + 11 files changed, 11 insertions(+) diff --git a/Dockerfiles/prod/Dockerfile-5.2 b/Dockerfiles/prod/Dockerfile-5.2 index b172931c..75b89538 100644 --- a/Dockerfiles/prod/Dockerfile-5.2 +++ b/Dockerfiles/prod/Dockerfile-5.2 @@ -24,6 +24,7 @@ RUN set -x \ locales-all \ postfix \ postfix-pcre \ + cron \ rsyslog \ socat \ supervisor \ diff --git a/Dockerfiles/prod/Dockerfile-5.3 b/Dockerfiles/prod/Dockerfile-5.3 index 75aa343e..a3fc49b4 100644 --- a/Dockerfiles/prod/Dockerfile-5.3 +++ b/Dockerfiles/prod/Dockerfile-5.3 @@ -24,6 +24,7 @@ RUN set -x \ locales-all \ postfix \ postfix-pcre \ + cron \ rsyslog \ socat \ supervisor \ diff --git a/Dockerfiles/prod/Dockerfile-5.4 b/Dockerfiles/prod/Dockerfile-5.4 index 78c6b13a..6365cdc7 100644 --- a/Dockerfiles/prod/Dockerfile-5.4 +++ b/Dockerfiles/prod/Dockerfile-5.4 @@ -24,6 +24,7 @@ RUN set -x \ locales-all \ postfix \ postfix-pcre \ + cron \ rsyslog \ socat \ supervisor \ diff --git a/Dockerfiles/prod/Dockerfile-5.5 b/Dockerfiles/prod/Dockerfile-5.5 index 6119145a..b97f6873 100644 --- a/Dockerfiles/prod/Dockerfile-5.5 +++ b/Dockerfiles/prod/Dockerfile-5.5 @@ -24,6 +24,7 @@ RUN set -x \ locales-all \ postfix \ postfix-pcre \ + cron \ rsyslog \ socat \ supervisor \ diff --git a/Dockerfiles/prod/Dockerfile-5.6 b/Dockerfiles/prod/Dockerfile-5.6 index f28b418c..d4aa7c77 100644 --- a/Dockerfiles/prod/Dockerfile-5.6 +++ b/Dockerfiles/prod/Dockerfile-5.6 @@ -24,6 +24,7 @@ RUN set -x \ locales-all \ postfix \ postfix-pcre \ + cron \ rsyslog \ socat \ supervisor \ diff --git a/Dockerfiles/prod/Dockerfile-7.0 b/Dockerfiles/prod/Dockerfile-7.0 index b22b6060..f2e1c97c 100644 --- a/Dockerfiles/prod/Dockerfile-7.0 +++ b/Dockerfiles/prod/Dockerfile-7.0 @@ -24,6 +24,7 @@ RUN set -x \ locales-all \ postfix \ postfix-pcre \ + cron \ rsyslog \ socat \ supervisor \ diff --git a/Dockerfiles/prod/Dockerfile-7.1 b/Dockerfiles/prod/Dockerfile-7.1 index ce8f18e9..723efc48 100644 --- a/Dockerfiles/prod/Dockerfile-7.1 +++ b/Dockerfiles/prod/Dockerfile-7.1 @@ -24,6 +24,7 @@ RUN set -x \ locales-all \ postfix \ postfix-pcre \ + cron \ rsyslog \ socat \ supervisor \ diff --git a/Dockerfiles/prod/Dockerfile-7.2 b/Dockerfiles/prod/Dockerfile-7.2 index a669405d..b51c04da 100644 --- a/Dockerfiles/prod/Dockerfile-7.2 +++ b/Dockerfiles/prod/Dockerfile-7.2 @@ -24,6 +24,7 @@ RUN set -x \ locales-all \ postfix \ postfix-pcre \ + cron \ rsyslog \ socat \ supervisor \ diff --git a/Dockerfiles/prod/Dockerfile-7.3 b/Dockerfiles/prod/Dockerfile-7.3 index 4d187308..6c7e4dbe 100644 --- a/Dockerfiles/prod/Dockerfile-7.3 +++ b/Dockerfiles/prod/Dockerfile-7.3 @@ -24,6 +24,7 @@ RUN set -x \ locales-all \ postfix \ postfix-pcre \ + cron \ rsyslog \ socat \ supervisor \ diff --git a/Dockerfiles/prod/Dockerfile-7.4 b/Dockerfiles/prod/Dockerfile-7.4 index cae332c2..0ec2dd3f 100644 --- a/Dockerfiles/prod/Dockerfile-7.4 +++ b/Dockerfiles/prod/Dockerfile-7.4 @@ -24,6 +24,7 @@ RUN set -x \ locales-all \ postfix \ postfix-pcre \ + cron \ rsyslog \ socat \ supervisor \ diff --git a/build/ansible/DOCKERFILES/Dockerfile-prod.j2 b/build/ansible/DOCKERFILES/Dockerfile-prod.j2 index 939694e9..07b1e0af 100644 --- a/build/ansible/DOCKERFILES/Dockerfile-prod.j2 +++ b/build/ansible/DOCKERFILES/Dockerfile-prod.j2 @@ -24,6 +24,7 @@ RUN set -x \ locales-all \ postfix \ postfix-pcre \ + cron \ rsyslog \ socat \ supervisor \