diff --git a/scripts/common-envs.mk b/scripts/common-envs.mk index bdff841b..ec11ada4 100644 --- a/scripts/common-envs.mk +++ b/scripts/common-envs.mk @@ -17,6 +17,8 @@ endif # Get the name of the selected docker buildx builder BUILDER ?= $(shell docker buildx inspect --bootstrap | head -n2 | awk '/^Name:/{print $$NF}') -# Get platforms supported by the builder -PLATFORM ?= $(shell docker buildx ls --format=json | jq -r 'select(.Name == "$(BUILDER)") | [.Nodes[].Platforms // []] | flatten | unique | map(select(test("^linux/amd64$$|^linux/arm64$$"))) | join(",")') +# Get platforms supported by the builder (only if PLATFORM is not provided) +ifeq ($(origin PLATFORM), undefined) +PLATFORM := $(shell docker buildx ls --format=json | jq -r 'select(.Name == "$(BUILDER)") | [.Nodes[].Platforms // []] | flatten | unique | map(select(test("^linux/amd64$$|^linux/arm64$$"))) | join(",")') +endif