forked from MilesChou/docker-phalcon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update.sh
executable file
·54 lines (44 loc) · 1.05 KB
/
update.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env bash
generated_warning() {
cat <<-EOH
#
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
EOH
}
generate_dockerfile() {
variants=$1
if [[ "$variants" != "" ]]; then
path=/$1
version_suffix=-${variants}
else
path=""
version_suffix=""
fi
# Prepare directories
mkdir -p ${version}${path}
generated_warning > ${version}${path}/Dockerfile
cat Dockerfile.template | \
sed -e 's!%%PHP_VERSION%%!'"${version}${version_suffix}"'!' | \
sed -e 's!%%PSR_VERSION%%!'"${PSR_VERSION}"'!' | \
sed -e 's!%%PHALCON_VERSION%%!'"${PHALCON_VERSION}"'!' \
>> ${version}${path}/Dockerfile
}
PSR_VERSION=1.1.0
PHALCON_VERSION=4.1.2
# Dockerfile on PHP 7 is customized
VERSIONS="
7.2
7.3
7.4
"
for version in ${VERSIONS}; do
major_version=$(echo ${version} | cut -f1 -d.)
generate_dockerfile
generate_dockerfile alpine
generate_dockerfile apache
generate_dockerfile fpm
generate_dockerfile fpm-alpine
done