Skip to content

Commit

Permalink
fix: emit BUILDKIT_MULTI_PLATFORM=1
Browse files Browse the repository at this point in the history
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 <jf@devklog.net>
Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
  • Loading branch information
jfroy authored and smira committed Nov 5, 2024
1 parent dd14759 commit 7db4f5e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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)"
Expand Down
3 changes: 2 additions & 1 deletion internal/project/common/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
3 changes: 2 additions & 1 deletion internal/project/pkgfile/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 7db4f5e

Please sign in to comment.