-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SONAR-20383 Add retry mechanism for multi-architecture docker build
- Loading branch information
1 parent
a1a383e
commit 67ae105
Showing
2 changed files
with
16 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
export DOCKER_BUILDKIT=1 | ||
for i in $(seq 1 3); do | ||
if docker buildx build --platform linux/amd64,linux/arm64 --tag "$1:$2" --push $3; then | ||
echo "[Success]: Buildx, attempt ${i}" | ||
break | ||
fi | ||
sleep 3 | ||
if [[ "${i}" == "3" ]]; then | ||
echo "[Error]: Context Deadline Exceeded - Buildx" | ||
exit 1 | ||
fi | ||
done |