File tree 2 files changed +60
-8
lines changed
2 files changed +60
-8
lines changed Original file line number Diff line number Diff line change @@ -53,12 +53,38 @@ jobs:
53
53
project : wl5hnrrkns
54
54
context : base-build-context
55
55
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
60
57
pull : true
61
58
no-cache : true
62
59
push : true
63
60
tags : |
64
61
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
Original file line number Diff line number Diff line change @@ -188,16 +188,42 @@ jobs:
188
188
project : wl5hnrrkns
189
189
context : base-build-context
190
190
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
195
192
pull : true
196
193
no-cache : true
197
194
push : true
198
195
tags : |
199
196
${{ steps.image-base-tag.outputs.tag }}
200
197
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
+
201
227
- name : Build Linux Docker images
202
228
run : |
203
229
set -euxo pipefail
You can’t perform that action at this time.
0 commit comments