Dockerfile: fall back to edge.kernel.org mirror when dl-cdn TLS fetch fails

This commit is contained in:
dev
2026-09-12 11:30:13 +03:00
parent db684efe9e
commit 21b00a8e09
+3 -1
View File
@@ -6,9 +6,11 @@ RUN npm install --omit=dev
COPY . . COPY . .
RUN mkdir -p uploads certs RUN mkdir -p uploads certs
RUN set -e; \ RUN set -e; \
V="v$(cut -d. -f1-2 /etc/alpine-release)"; \
i=1; \ i=1; \
until apk add --no-cache openssl; do \ until apk add --no-cache openssl; do \
echo "apk add failed on attempt $i, retrying in 5s..."; \ echo "apk add failed on attempt $i, switching to backup mirror..."; \
printf "https://mirrors.edge.kernel.org/alpine/%s/main\nhttps://mirrors.edge.kernel.org/alpine/%s/community\n" "$V" "$V" > /etc/apk/repositories; \
i=$((i+1)); \ i=$((i+1)); \
if [ $i -gt 6 ]; then echo "apk add failed after 6 attempts"; exit 1; fi; \ if [ $i -gt 6 ]; then echo "apk add failed after 6 attempts"; exit 1; fi; \
sleep 5; \ sleep 5; \