From a81a6cefbf66cf3c3d118f4d32f840209116aabe Mon Sep 17 00:00:00 2001 From: Fallen_Breath Date: Sat, 30 Dec 2023 16:18:26 +0800 Subject: [PATCH] temurin dynamic wait time --- src/Dockerfile-openjdk-temurin | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Dockerfile-openjdk-temurin b/src/Dockerfile-openjdk-temurin index 2b89de5..625c945 100644 --- a/src/Dockerfile-openjdk-temurin +++ b/src/Dockerfile-openjdk-temurin @@ -19,14 +19,15 @@ apt-get update # https://github.com/adoptium/installer/issues/766 set +e attempts=5 +wait_times=(1 3 5 10) for attempt in $(seq 1 $attempts); do if apt-get install -y "temurin-${JAVA}-jdk"; then break fi if [ "$attempt" != "$attempts" ]; then - echo "Install attempt #$attempt failed. Waiting 60 seconds for another attempt..." - sleep 60 - update-ca-certificates + wait_time=${wait_times[$((attempt-1))]} + echo "Install attempt #$attempt failed. Waiting ${wait_time} minutes for another attempt..." + sleep $((wait_time * 60)) else echo "All $attempts attempts failed" exit 1