feat: add retry logic and explicit Alpine repositories to gateway Dockerfile

Add explicit Alpine 3.21 main and community repository URLs to /etc/apk/repositories. Implement 5-attempt retry loop with 3-second delays for apk update and package installation to handle transient network failures during Docker builds.
This commit is contained in:
2026-03-18 08:59:44 +01:00
parent 137fb1d3e7
commit a2df8c33d4

View File

@@ -1,6 +1,16 @@
FROM alpine:3.21 FROM alpine:3.21
RUN apk add --no-cache bash curl jq wireguard-tools nftables RUN set -eux; \
printf '%s\n' \
'https://dl-cdn.alpinelinux.org/alpine/v3.21/main' \
'https://dl-cdn.alpinelinux.org/alpine/v3.21/community' \
> /etc/apk/repositories; \
for attempt in 1 2 3 4 5; do \
apk update && apk add --no-cache bash curl jq wireguard-tools nftables && exit 0; \
echo "apk install attempt ${attempt} failed, retrying..." >&2; \
sleep 3; \
done; \
exit 1
WORKDIR /app WORKDIR /app
COPY scripts/gateway-entrypoint.sh /scripts/gateway-entrypoint.sh COPY scripts/gateway-entrypoint.sh /scripts/gateway-entrypoint.sh