From fcb60fa91c8f1d1a4f028a6ffc615e087ae0cb0c Mon Sep 17 00:00:00 2001 From: Matthew Shotton Date: Fri, 12 Jun 2020 15:11:15 -0700 Subject: [PATCH] Added multi-arch makefile build option --- Makefile | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Makefile b/Makefile index 989489c623..e907129110 100644 --- a/Makefile +++ b/Makefile @@ -20,6 +20,9 @@ HOSTMOUNT_PREFIX := /host- KUBECONFIG := E2E_TEST_CONFIG := +MULTIARCH_IMAGE_ARCHITECTURES := linux/amd64,linux/arm64,linux/arm/v7 +MULTIARCH_IMAGE_BUILD_CMD := docker buildx build + yaml_templates := $(wildcard *.yaml.template) yaml_instances := $(patsubst %.yaml.template,%.yaml,$(yaml_templates)) @@ -31,6 +34,14 @@ image: yamls -t $(IMAGE_TAG) \ $(IMAGE_BUILD_EXTRA_OPTS) ./ +push-multiarch: yamls + $(MULTIARCH_IMAGE_BUILD_CMD) --push \ + --platform $(MULTIARCH_IMAGE_ARCHITECTURES) \ + --build-arg NFD_VERSION=$(VERSION) \ + --build-arg HOSTMOUNT_PREFIX=$(HOSTMOUNT_PREFIX) \ + -t $(IMAGE_TAG) \ + $(IMAGE_BUILD_EXTRA_OPTS) ./ + yamls: $(yaml_instances) %.yaml: %.yaml.template .FORCE