From 18db7e679fd92e2d36d6113b1e174e6f1afda2d6 Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Sat, 31 Mar 2018 11:43:55 +0200 Subject: [PATCH] Dockerfile: redirect the contributor to update.sh The `*/*/Dockerfile` are created from `Docker*template` by the update.sh script. We add a comment at the beginning of the file with information to find their origin. We also make them readonly to remind people who would like to improve these files that they are not meant to be modified. --- 11.0/apache/Dockerfile | 1 + 11.0/fpm-alpine/Dockerfile | 1 + 11.0/fpm/Dockerfile | 1 + 12.0/apache/Dockerfile | 1 + 12.0/fpm-alpine/Dockerfile | 1 + 12.0/fpm/Dockerfile | 1 + 13.0/apache/Dockerfile | 1 + 13.0/fpm-alpine/Dockerfile | 1 + 13.0/fpm/Dockerfile | 1 + update.sh | 7 ++++++- 10 files changed, 15 insertions(+), 1 deletion(-) diff --git a/11.0/apache/Dockerfile b/11.0/apache/Dockerfile index 4fa051f..7c2e09c 100644 --- a/11.0/apache/Dockerfile +++ b/11.0/apache/Dockerfile @@ -1,3 +1,4 @@ +# DO NOT EDIT: created by update.sh from Dockerfile-debian.template FROM php:7.1-apache # entrypoint.sh and cron.sh dependencies diff --git a/11.0/fpm-alpine/Dockerfile b/11.0/fpm-alpine/Dockerfile index 198eba7..16c3720 100644 --- a/11.0/fpm-alpine/Dockerfile +++ b/11.0/fpm-alpine/Dockerfile @@ -1,3 +1,4 @@ +# DO NOT EDIT: created by update.sh from Dockerfile-alpine.template FROM php:7.1-fpm-alpine # entrypoint.sh and cron.sh dependencies diff --git a/11.0/fpm/Dockerfile b/11.0/fpm/Dockerfile index 512aca6..13584b6 100644 --- a/11.0/fpm/Dockerfile +++ b/11.0/fpm/Dockerfile @@ -1,3 +1,4 @@ +# DO NOT EDIT: created by update.sh from Dockerfile-debian.template FROM php:7.1-fpm # entrypoint.sh and cron.sh dependencies diff --git a/12.0/apache/Dockerfile b/12.0/apache/Dockerfile index 130d2c7..6f0439d 100644 --- a/12.0/apache/Dockerfile +++ b/12.0/apache/Dockerfile @@ -1,3 +1,4 @@ +# DO NOT EDIT: created by update.sh from Dockerfile-debian.template FROM php:7.1-apache # entrypoint.sh and cron.sh dependencies diff --git a/12.0/fpm-alpine/Dockerfile b/12.0/fpm-alpine/Dockerfile index 9a76cac..928cf25 100644 --- a/12.0/fpm-alpine/Dockerfile +++ b/12.0/fpm-alpine/Dockerfile @@ -1,3 +1,4 @@ +# DO NOT EDIT: created by update.sh from Dockerfile-alpine.template FROM php:7.1-fpm-alpine # entrypoint.sh and cron.sh dependencies diff --git a/12.0/fpm/Dockerfile b/12.0/fpm/Dockerfile index 26dee8d..6483bed 100644 --- a/12.0/fpm/Dockerfile +++ b/12.0/fpm/Dockerfile @@ -1,3 +1,4 @@ +# DO NOT EDIT: created by update.sh from Dockerfile-debian.template FROM php:7.1-fpm # entrypoint.sh and cron.sh dependencies diff --git a/13.0/apache/Dockerfile b/13.0/apache/Dockerfile index 8e2b203..61a4c34 100644 --- a/13.0/apache/Dockerfile +++ b/13.0/apache/Dockerfile @@ -1,3 +1,4 @@ +# DO NOT EDIT: created by update.sh from Dockerfile-debian.template FROM php:7.1-apache # entrypoint.sh and cron.sh dependencies diff --git a/13.0/fpm-alpine/Dockerfile b/13.0/fpm-alpine/Dockerfile index 828be93..bd28f49 100644 --- a/13.0/fpm-alpine/Dockerfile +++ b/13.0/fpm-alpine/Dockerfile @@ -1,3 +1,4 @@ +# DO NOT EDIT: created by update.sh from Dockerfile-alpine.template FROM php:7.1-fpm-alpine # entrypoint.sh and cron.sh dependencies diff --git a/13.0/fpm/Dockerfile b/13.0/fpm/Dockerfile index d073380..ac61eed 100644 --- a/13.0/fpm/Dockerfile +++ b/13.0/fpm/Dockerfile @@ -1,3 +1,4 @@ +# DO NOT EDIT: created by update.sh from Dockerfile-debian.template FROM php:7.1-fpm # entrypoint.sh and cron.sh dependencies diff --git a/update.sh b/update.sh index 7b5dbdf..aa3805a 100755 --- a/update.sh +++ b/update.sh @@ -55,7 +55,10 @@ function create_variant() { # Create the version+variant directory with a Dockerfile. mkdir -p "$dir" - cp "Dockerfile-${base[$variant]}.template" "$dir/Dockerfile" + template="Dockerfile-${base[$variant]}.template" + rm -f "$dir/Dockerfile" + echo "# DO NOT EDIT: created by update.sh from $template" > "$dir/Dockerfile" + cat "$template" >> "$dir/Dockerfile" echo "updating $fullversion [$1] $variant" @@ -71,6 +74,8 @@ function create_variant() { s/%%MEMCACHED_VERSION%%/'"${pecl_versions[memcached]}"'/g; s/%%REDIS_VERSION%%/'"${pecl_versions[redis]}"'/g; ' "$dir/Dockerfile" + # remove write permission as a reminder this file must be modified with this script + chmod -w "$dir/Dockerfile" # Copy the shell scripts for name in entrypoint cron; do