Skip to content

Commit 31a3702

Browse files
authored
fix: build for all platforms in depot release pt. 2 (#6407)
1 parent 9af03d6 commit 31a3702

File tree

2 files changed

+60
-8
lines changed

2 files changed

+60
-8
lines changed

.github/workflows/docker-base.yaml

+30-4
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,38 @@ jobs:
5353
project: wl5hnrrkns
5454
context: base-build-context
5555
file: scripts/Dockerfile.base
56-
platforms:
57-
- linux/amd64
58-
- linux/arm64
59-
- linux/arm/v7
56+
platforms: linux/amd64,linux/arm64,linux/arm/v7
6057
pull: true
6158
no-cache: true
6259
push: true
6360
tags: |
6461
ghcr.io/coder/coder-base:latest
62+
63+
- name: Verify that images are pushed properly
64+
run: |
65+
# retry 10 times with a 5 second delay as the images may not be
66+
# available immediately
67+
for i in {1..10}; do
68+
rc=0
69+
raw_manifests=$(docker buildx imagetools inspect --raw ghcr.io/coder/coder-base:latest) || rc=$?
70+
if [[ "$rc" -eq 0 ]]; then
71+
break
72+
fi
73+
if [[ "$i" -eq 10 ]]; then
74+
echo "Failed to pull manifests after 10 retries"
75+
exit 1
76+
fi
77+
echo "Failed to pull manifests, retrying in 5 seconds"
78+
sleep 5
79+
done
80+
81+
manifests=$(
82+
echo "$raw_manifests" | \
83+
jq -r '.manifests[].platform | .os + "/" + .architecture + (if .variant then "/" + .variant else "" end)'
84+
)
85+
86+
# Verify all 3 platforms are present.
87+
set -euxo pipefail
88+
echo "$manifests" | grep -q linux/amd64
89+
echo "$manifests" | grep -q linux/arm64
90+
echo "$manifests" | grep -q linux/arm/v7

.github/workflows/release.yaml

+30-4
Original file line numberDiff line numberDiff line change
@@ -188,16 +188,42 @@ jobs:
188188
project: wl5hnrrkns
189189
context: base-build-context
190190
file: scripts/Dockerfile.base
191-
platforms:
192-
- linux/amd64
193-
- linux/arm64
194-
- linux/arm/v7
191+
platforms: linux/amd64,linux/arm64,linux/arm/v7
195192
pull: true
196193
no-cache: true
197194
push: true
198195
tags: |
199196
${{ steps.image-base-tag.outputs.tag }}
200197
198+
- name: Verify that images are pushed properly
199+
run: |
200+
# retry 10 times with a 5 second delay as the images may not be
201+
# available immediately
202+
for i in {1..10}; do
203+
rc=0
204+
raw_manifests=$(docker buildx imagetools inspect --raw "${{ steps.image-base-tag.outputs.tag }}") || rc=$?
205+
if [[ "$rc" -eq 0 ]]; then
206+
break
207+
fi
208+
if [[ "$i" -eq 10 ]]; then
209+
echo "Failed to pull manifests after 10 retries"
210+
exit 1
211+
fi
212+
echo "Failed to pull manifests, retrying in 5 seconds"
213+
sleep 5
214+
done
215+
216+
manifests=$(
217+
echo "$raw_manifests" | \
218+
jq -r '.manifests[].platform | .os + "/" + .architecture + (if .variant then "/" + .variant else "" end)'
219+
)
220+
221+
# Verify all 3 platforms are present.
222+
set -euxo pipefail
223+
echo "$manifests" | grep -q linux/amd64
224+
echo "$manifests" | grep -q linux/arm64
225+
echo "$manifests" | grep -q linux/arm/v7
226+
201227
- name: Build Linux Docker images
202228
run: |
203229
set -euxo pipefail

0 commit comments

Comments
 (0)