Skip to content

Commit 4a5875f

Browse files
committed
update.sh: Add 'php_version' variable
Signed-off-by: Daniel Rudolf <[email protected]>
1 parent 5239485 commit 4a5875f

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

Dockerfile-alpine.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM php:8.1-%%VARIANT%%
1+
FROM php:%%PHP_VERSION%%-%%VARIANT%%
22

33
# docker-entrypoint.sh dependencies
44
RUN apk add --no-cache \

Dockerfile-debian.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM php:8.1-%%VARIANT%%
1+
FROM php:%%PHP_VERSION%%-%%VARIANT%%
22

33
# Install dependencies
44
RUN set -ex; \

update.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ command -v jq >/dev/null 2>&1 || { echo >&2 "'jq' is required but not found. Abo
77
[ -n "${BASH_VERSINFO}" ] && [ -n "${BASH_VERSINFO[0]}" ] && [ ${BASH_VERSINFO[0]} -ge 4 ] \
88
|| { echo >&2 "Bash 4.0 or greater is required. Aborting."; exit 1; }
99

10+
declare -A php_version=(
11+
[default]='8.1'
12+
)
13+
1014
declare -A cmd=(
1115
[apache]='apache2-foreground'
1216
[fpm]='php-fpm'
@@ -33,6 +37,7 @@ function create_variant() {
3337
local branch="$(sed -ne 's/^\([0-9]*\.[0-9]*\)\..*$/\1/p' <<< "$version")"
3438
local url="$(download_url "$version")"
3539
local ascUrl="$(download_url "$version").asc"
40+
local phpVersion="${php_version[$version]-${php_version[default]}}"
3641

3742
echo "updating $version [$branch] $variant"
3843

@@ -45,6 +50,7 @@ function create_variant() {
4550
s/%%SHA256%%/'"$sha256"'/;
4651
s/%%DOWNLOAD_URL%%/'"$(sed -e 's/[\/&]/\\&/g' <<< "$url")"'/;
4752
s/%%DOWNLOAD_URL_ASC%%/'"$(sed -e 's/[\/&]/\\&/g' <<< "$ascUrl")"'/;
53+
s/%%PHP_VERSION%%/'"$phpVersion"'/g;
4854
s/%%GPG_KEY%%/'"$gpg_key"'/g;
4955
s/%%VARIANT%%/'"$variant"'/;
5056
s/%%CMD%%/'"${cmd[$variant]}"'/;

0 commit comments

Comments
 (0)