From a4416874cf8d2d0f88cfbb2fb3cebac62a8e3a33 Mon Sep 17 00:00:00 2001 From: Tiger Kaovilai Date: Fri, 27 Sep 2024 10:26:34 -0400 Subject: [PATCH 1/2] Allow multi-arch manifest-list from `make container` by changing output type to image. Then you can execute command like so to create a multi-arch image ``` BUILDX_PLATFORMS=linux/amd64,linux/arm64 BUILDX_OUTPUT_TYPE=image make container ``` Signed-off-by: Tiger Kaovilai --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 401ee47d0c..be8b30de4a 100644 --- a/Makefile +++ b/Makefile @@ -100,7 +100,7 @@ RESTIC_VERSION ?= 0.15.0 CLI_PLATFORMS ?= linux-amd64 linux-arm linux-arm64 darwin-amd64 darwin-arm64 windows-amd64 linux-ppc64le BUILDX_PLATFORMS ?= $(subst -,/,$(ARCH)) -BUILDX_OUTPUT_TYPE ?= docker +BUILDX_OUTPUT_TYPE ?= image # set git sha and tree state GIT_SHA = $(shell git rev-parse HEAD) From 3f4a1c295a8b5e248a9f2ea789587bfe21cbe9f4 Mon Sep 17 00:00:00 2001 From: Tiger Kaovilai Date: Tue, 1 Oct 2024 16:13:55 -0400 Subject: [PATCH 2/2] Makefile: Add BUILDX_PUSH var Signed-off-by: Tiger Kaovilai --- Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index be8b30de4a..adc8c5117e 100644 --- a/Makefile +++ b/Makefile @@ -94,13 +94,15 @@ define BUILDX_ERROR buildx not enabled, refusing to run this recipe see: https://velero.io/docs/main/build-from-source/#making-images-and-updating-velero for more info endef - +# comma cannot be escaped and can only be used in Make function arguments by putting into variable +comma=, # The version of restic binary to be downloaded RESTIC_VERSION ?= 0.15.0 CLI_PLATFORMS ?= linux-amd64 linux-arm linux-arm64 darwin-amd64 darwin-arm64 windows-amd64 linux-ppc64le BUILDX_PLATFORMS ?= $(subst -,/,$(ARCH)) -BUILDX_OUTPUT_TYPE ?= image +BUILDX_PUSH ?= false +BUILDX_OUTPUT_TYPE ?= image$(subst false,,$(subst true,$(comma)push=true,$(BUILDX_PUSH))) # set git sha and tree state GIT_SHA = $(shell git rev-parse HEAD)