File tree Expand file tree Collapse file tree 3 files changed +15
-7
lines changed Expand file tree Collapse file tree 3 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ RUN set -ex; \
70
70
# Calculate download URL
71
71
ENV VERSION %%VERSION%%
72
72
ENV SHA256 %%SHA256%%
73
- ENV URL https://files.phpmyadmin.net/phpMyAdmin/${VERSION}/phpMyAdmin-${VERSION}-all-languages.tar.xz
73
+ ENV URL %%DOWNLOAD_URL%%
74
74
75
75
LABEL org.opencontainers.image.title="Official phpMyAdmin Docker image" \
76
76
org.opencontainers.image.description="Run phpMyAdmin with Alpine, Apache and PHP FPM." \
@@ -90,8 +90,8 @@ RUN set -ex; \
90
90
\
91
91
export GNUPGHOME="$(mktemp -d)"; \
92
92
export GPGKEY="3D06A59ECE730EB71B511C17CE752F178259BD92"; \
93
- curl -fsSL -o phpMyAdmin.tar.xz $URL ; \
94
- curl -fsSL -o phpMyAdmin.tar.xz.asc $URL.asc ; \
93
+ curl -fsSL -o phpMyAdmin.tar.xz "%%DOWNLOAD_URL%%" ; \
94
+ curl -fsSL -o phpMyAdmin.tar.xz.asc "%%DOWNLOAD_URL_ASC%%" ; \
95
95
echo "$SHA256 *phpMyAdmin.tar.xz" | sha256sum -c -; \
96
96
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$GPGKEY" \
97
97
|| gpg --batch --keyserver pgp.mit.edu --recv-keys "$GPGKEY" \
Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ RUN set -ex; \
72
72
# Calculate download URL
73
73
ENV VERSION %%VERSION%%
74
74
ENV SHA256 %%SHA256%%
75
- ENV URL https://files.phpmyadmin.net/phpMyAdmin/${VERSION}/phpMyAdmin-${VERSION}-all-languages.tar.xz
75
+ ENV URL %%DOWNLOAD_URL%%
76
76
77
77
LABEL org.opencontainers.image.title="Official phpMyAdmin Docker image" \
78
78
org.opencontainers.image.description="Run phpMyAdmin with Alpine, Apache and PHP FPM." \
@@ -97,8 +97,8 @@ RUN set -ex; \
97
97
\
98
98
export GNUPGHOME="$(mktemp -d)"; \
99
99
export GPGKEY="3D06A59ECE730EB71B511C17CE752F178259BD92"; \
100
- curl -fsSL -o phpMyAdmin.tar.xz $URL ; \
101
- curl -fsSL -o phpMyAdmin.tar.xz.asc $URL.asc ; \
100
+ curl -fsSL -o phpMyAdmin.tar.xz "%%DOWNLOAD_URL%%" ; \
101
+ curl -fsSL -o phpMyAdmin.tar.xz.asc "%%DOWNLOAD_URL_ASC%%" ; \
102
102
echo "$SHA256 *phpMyAdmin.tar.xz" | sha256sum -c -; \
103
103
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$GPGKEY" \
104
104
|| gpg --batch --keyserver pgp.mit.edu --recv-keys "$GPGKEY" \
Original file line number Diff line number Diff line change @@ -19,12 +19,18 @@ declare -A base=(
19
19
[fpm-alpine]=' alpine'
20
20
)
21
21
22
+ function download_url() {
23
+ echo " https://files.phpmyadmin.net/phpMyAdmin/$1 /phpMyAdmin-$1 -all-languages.tar.xz"
24
+ }
25
+
22
26
function create_variant() {
23
27
local variant=" $1 "
24
28
local version=" $2 "
25
29
local sha256=" $3 "
26
30
27
31
local branch=" $( sed -ne ' s/^\([0-9]*\.[0-9]*\)\..*$/\1/p' <<< " $version" ) "
32
+ local url=" $( download_url " $version " ) "
33
+ local ascUrl=" $( download_url " $version " ) .asc"
28
34
29
35
echo " updating $version [$branch ] $variant "
30
36
@@ -35,6 +41,8 @@ function create_variant() {
35
41
sed -ri -e '
36
42
s/%%VERSION%%/' " $version " ' /;
37
43
s/%%SHA256%%/' " $sha256 " ' /;
44
+ s/%%DOWNLOAD_URL%%/' " $( sed -e ' s/[\/&]/\\&/g' <<< " $url" ) " ' /;
45
+ s/%%DOWNLOAD_URL_ASC%%/' " $( sed -e ' s/[\/&]/\\&/g' <<< " $ascUrl" ) " ' /;
38
46
s/%%VARIANT%%/' " $variant " ' /;
39
47
s/%%CMD%%/' " ${cmd[$variant]} " ' /;
40
48
' " $variant /Dockerfile"
@@ -44,7 +52,7 @@ function create_variant() {
44
52
}
45
53
46
54
latest=" $( curl -fsSL ' https://www.phpmyadmin.net/home_page/version.json' | jq -r ' .version' ) "
47
- sha256=" $( curl -fsSL " https://files.phpmyadmin.net/phpMyAdmin/ $latest /phpMyAdmin- $latest -all-languages.tar.xz .sha256" | cut -f1 -d ' ' | tr -cd ' a-f0-9' | cut -c 1-64) "
55
+ sha256=" $( curl -fsSL " $( download_url " $latest " ) .sha256" | cut -f1 -d ' ' | tr -cd ' a-f0-9' | cut -c 1-64) "
48
56
49
57
for variant in apache fpm fpm-alpine; do
50
58
create_variant " $variant " " $latest " " $sha256 "
You can’t perform that action at this time.
0 commit comments