From 7db4f5e2647e1bbccf6915ff3d84a0754e1b5057 Mon Sep 17 00:00:00 2001 From: Jean-Francois Roy Date: Mon, 4 Nov 2024 15:48:18 -0800 Subject: [PATCH] fix: emit BUILDKIT_MULTI_PLATFORM=1 Image Factory assumes registry images are multi-architecture (e.g. the top-level object is an image index). However builx will push a raw image manifest if it only has one image to push (single architecture, no provenance or attestaton). Passing `BUILDKIT_MULTI_PLATFORM=1` ensures an image index is always pushed. Signed-off-by: Jean-Francois Roy Signed-off-by: Andrey Smirnov --- Makefile | 3 ++- internal/project/common/docker.go | 3 ++- internal/project/pkgfile/build.go | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index cbbf3993..18954fb1 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ # THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. # -# Generated on 2024-10-22T09:07:30Z by kres 34e72ac-dirty. +# Generated on 2024-11-05T09:30:48Z by kres 38fd548. # common variables @@ -46,6 +46,7 @@ COMMON_ARGS += --provenance=false COMMON_ARGS += --progress=$(PROGRESS) COMMON_ARGS += --platform=$(PLATFORM) COMMON_ARGS += --push=$(PUSH) +COMMON_ARGS += --build-arg=BUILDKIT_MULTI_PLATFORM=1 COMMON_ARGS += --build-arg=ARTIFACTS="$(ARTIFACTS)" COMMON_ARGS += --build-arg=SHA="$(SHA)" COMMON_ARGS += --build-arg=TAG="$(TAG)" diff --git a/internal/project/common/docker.go b/internal/project/common/docker.go index 3627c0dc..96e0284f 100644 --- a/internal/project/common/docker.go +++ b/internal/project/common/docker.go @@ -117,7 +117,8 @@ func (docker *Docker) CompileMakefile(output *makefile.Output) error { Push("--provenance=false"). Push("--progress=$(PROGRESS)"). Push("--platform=$(PLATFORM)"). - Push("--push=$(PUSH)") + Push("--push=$(PUSH)"). + Push("--build-arg=BUILDKIT_MULTI_PLATFORM=1") for _, arg := range docker.meta.BuildArgs { buildArgs.Push(fmt.Sprintf("--build-arg=%s=\"$(%s)\"", arg, arg)) diff --git a/internal/project/pkgfile/build.go b/internal/project/pkgfile/build.go index 7dc78dbf..7d4a001a 100644 --- a/internal/project/pkgfile/build.go +++ b/internal/project/pkgfile/build.go @@ -83,7 +83,8 @@ func (pkgfile *Build) CompileMakefile(output *makefile.Output) error { Push("--provenance=false"). Push("--progress=$(PROGRESS)"). Push("--platform=$(PLATFORM)"). - Push("--build-arg=SOURCE_DATE_EPOCH=$(SOURCE_DATE_EPOCH)") + Push("--build-arg=SOURCE_DATE_EPOCH=$(SOURCE_DATE_EPOCH)"). + Push("--build-arg=BUILDKIT_MULTI_PLATFORM=1") for _, arg := range pkgfile.ExtraBuildArgs { buildArgs.Push(fmt.Sprintf("--build-arg=%s=\"$(%s)\"", arg, arg))