From b1a55387997eb95bcd250ef157460523262e113c Mon Sep 17 00:00:00 2001 From: Brad Stein Date: Sun, 12 Apr 2026 11:04:13 -0300 Subject: [PATCH] ci: fix local image buildx load platform --- scripts/ci/build-images.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/ci/build-images.sh b/scripts/ci/build-images.sh index 097c086..b233d6b 100755 --- a/scripts/ci/build-images.sh +++ b/scripts/ci/build-images.sh @@ -18,18 +18,24 @@ should_push() { build_with_buildx() { local dockerfile=$1 local image=$2 + local platform_args=() if should_push; then + platform_args=(--platform "${PLATFORMS}") docker buildx build \ - --platform "${PLATFORMS}" \ + "${platform_args[@]}" \ -f "${dockerfile}" \ -t "${image}:${IMAGE_TAG}" \ -t "${image}:latest" \ --push \ "${ROOT_DIR}" else + # buildx cannot `--load` a manifest list, so load the host platform only. + local host_platform + host_platform="$(docker version --format '{{.Server.Os}}/{{.Server.Arch}}' 2>/dev/null || echo linux/amd64)" + platform_args=(--platform "${host_platform}") docker buildx build \ - --platform "${PLATFORMS}" \ + "${platform_args[@]}" \ -f "${dockerfile}" \ -t "${image}:${IMAGE_TAG}" \ -t "${image}:latest" \