Skip to content

Commit

Permalink
temurin dynamic wait time
Browse files Browse the repository at this point in the history
  • Loading branch information
Fallen-Breath committed Dec 30, 2023
1 parent 6e33d85 commit a81a6ce
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Dockerfile-openjdk-temurin
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a81a6ce

Please sign in to comment.