Dockerfile: retry apk add on transient Alpine mirror TLS failures
This commit is contained in:
+8
-1
@@ -5,7 +5,14 @@ COPY package.json package-lock.json* ./
|
|||||||
RUN npm install --omit=dev
|
RUN npm install --omit=dev
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN mkdir -p uploads certs
|
RUN mkdir -p uploads certs
|
||||||
RUN apk add --no-cache openssl && \
|
RUN set -e; \
|
||||||
|
i=1; \
|
||||||
|
until apk add --no-cache openssl; do \
|
||||||
|
echo "apk add failed on attempt $i, retrying in 5s..."; \
|
||||||
|
i=$((i+1)); \
|
||||||
|
if [ $i -gt 6 ]; then echo "apk add failed after 6 attempts"; exit 1; fi; \
|
||||||
|
sleep 5; \
|
||||||
|
done && \
|
||||||
openssl req -x509 -nodes -newkey rsa:2048 -days 3650 \
|
openssl req -x509 -nodes -newkey rsa:2048 -days 3650 \
|
||||||
-keyout certs/key.pem -out certs/cert.pem \
|
-keyout certs/key.pem -out certs/cert.pem \
|
||||||
-subj "/CN=whatido.local" -addext "subjectAltName=DNS:localhost,IP:127.0.0.1"
|
-subj "/CN=whatido.local" -addext "subjectAltName=DNS:localhost,IP:127.0.0.1"
|
||||||
|
|||||||
Reference in New Issue
Block a user