From a82a812df022e59abb36e19d1803022aba0864c2 Mon Sep 17 00:00:00 2001 From: Tilo Spannagel Date: Thu, 8 Mar 2018 09:52:55 +0100 Subject: [PATCH] Use var for the php version --- Dockerfile-alpine.template | 2 +- Dockerfile-debian.template | 2 +- update.sh | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Dockerfile-alpine.template b/Dockerfile-alpine.template index b1a0f96b..42b6318a 100644 --- a/Dockerfile-alpine.template +++ b/Dockerfile-alpine.template @@ -1,4 +1,4 @@ -FROM php:7.1-%%VARIANT%% +FROM php:%%PHP_VERSION%%-%%VARIANT%% # entrypoint.sh and cron.sh dependencies RUN set -ex; \ diff --git a/Dockerfile-debian.template b/Dockerfile-debian.template index a5db872a..e55ce5e9 100644 --- a/Dockerfile-debian.template +++ b/Dockerfile-debian.template @@ -1,4 +1,4 @@ -FROM php:7.1-%%VARIANT%% +FROM php:%%PHP_VERSION%%-%%VARIANT%% # entrypoint.sh and cron.sh dependencies RUN set -ex; \ diff --git a/update.sh b/update.sh index dc54b070..c14a551a 100755 --- a/update.sh +++ b/update.sh @@ -1,6 +1,10 @@ #!/bin/bash set -eo pipefail +declare -A php_version=( + [default]='7.1' +) + declare -A cmd=( [apache]='apache2-foreground' [fpm]='php-fpm' @@ -59,6 +63,7 @@ for latest in "${latests[@]}"; do # Replace the variables. sed -ri -e ' + s/%%PHP_VERSION%%/'"${php_version[$version]-${php_version[default]}}"'/g; s/%%VARIANT%%/'"$variant"'/g; s/%%VERSION%%/'"$latest"'/g; s/%%CMD%%/'"${cmd[$variant]}"'/g;