[dx] Allow to not specify BUILDER for makefile if PLATFORM specified
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
This commit is contained in:
parent
3b32bfe149
commit
8704767ac5
1 changed files with 4 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue