Skip to content

Commit a316a64

Browse files
committed
retry docker fetch
1 parent f150d52 commit a316a64

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

.github/workflows/CI.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,21 @@ jobs:
2828
architecture: x64
2929
- name: Make wheel
3030
run: |
31-
sudo docker build -t flatterer-anylinux .
31+
# quay.io can be flaky, so retry the build (which pulls the base image) a few times
32+
for attempt in 1 2 3 4 5; do
33+
echo "::group::docker build (attempt $attempt)"
34+
if sudo docker build -t flatterer-anylinux .; then
35+
echo "::endgroup::"
36+
break
37+
fi
38+
echo "::endgroup::"
39+
if [ "$attempt" -eq 5 ]; then
40+
echo "docker build failed after $attempt attempts" >&2
41+
exit 1
42+
fi
43+
echo "docker build failed (attempt $attempt), retrying in $((attempt * 5))s..."
44+
sleep $((attempt * 5))
45+
done
3246
sudo docker run -v $(pwd):/io flatterer-anylinux build -f --release --out dist
3347
- name: Upload wheels
3448
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)