Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SONAR-20383 Fix flaky issue on docker buildx #647

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ multi_arch_build_task:
- docker login --username $DOCKER_USERNAME --password $DOCKER_PASSWORD
setup_script:
- docker run -t --rm --privileged tonistiigi/binfmt --install all
- docker buildx create --name multibuilder
- docker buildx create --name multibuilder --driver docker-container
- docker buildx use multibuilder
- docker buildx inspect --bootstrap
build_script:
- echo "Build the ${STAGING_IMAGE_NAME}:${tag} image supporting two architectures, linux/amd64 and linux/arm64"
- docker buildx build --platform linux/amd64,linux/arm64 --tag "${STAGING_IMAGE_NAME}:${tag}" --push ${version}
- .cirrus/multi-arch-build.sh ${STAGING_IMAGE_NAME} ${tag} ${version}

private_scan_task:
env:
Expand Down
12 changes: 12 additions & 0 deletions .cirrus/multi-arch-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

export DOCKER_BUILDKIT=1
carminevassallo marked this conversation as resolved.
Show resolved Hide resolved
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}"
exit 0
fi
sleep 3
done
echo "[Error]: Context Deadline Exceeded - Buildx"
exit 1