Skip to content

Commit 0854fe6

Browse files
authored
Fix alpine plus dockerfile on alpine>=3.17 (#511)
1 parent 0caccac commit 0854fe6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

scripts/docker/nginx-plus/alpine/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@ RUN --mount=type=secret,id=nginx-crt,dst=/etc/apk/cert.pem \
1616
&& addgroup -g 101 -S nginx \
1717
&& adduser -S -D -H -u 101 -h /var/cache/nginx -s /sbin/nologin -G nginx -g nginx nginx \
1818
# Check signing key
19-
&& KEY_SHA512="e7fa8303923d9b95db37a77ad46c68fd4755ff935d0a534d26eba83de193c76166c68bfe7f65471bf8881004ef4aa6df3e34689c305662750c0172fca5d8552a *stdin" \
19+
&& KEY_SHA512="de7031fdac1354096d3388d6f711a508328ce66c168967ee0658c294226d6e7a161ce7f2628d577d56f8b63ff6892cc576af6f7ef2a6aa2e17c62ff7b6bf0d98 *stdin" \
2020
&& apk add --no-cache --virtual .cert-deps \
2121
openssl \
2222
&& wget -O /tmp/nginx_signing.rsa.pub https://nginx.org/keys/nginx_signing.rsa.pub \
23-
&& if [ "$(openssl rsa -pubin -in /tmp/nginx_signing.rsa.pub -text -noout | openssl sha512 -r)" = "$KEY_SHA512" ]; then \
23+
# sed replace is required for openssl=v1.x which is used in alpine<=3.16
24+
&& if [ "$(openssl rsa -pubin -in /tmp/nginx_signing.rsa.pub -text -noout | sed -e 's/RSA Public-Key/Public-Key/' | openssl sha512 -r)" = "$KEY_SHA512" ]; then \
2425
echo "key verification succeeded!"; \
2526
mv /tmp/nginx_signing.rsa.pub /etc/apk/keys/; \
2627
else \

0 commit comments

Comments
 (0)