From 50120593a37cd25ef98698a25aaa2c8b0379812c Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Mon, 25 Mar 2024 22:28:04 -0400 Subject: [PATCH] Makefile: define BUILD_CMD and apply to web-wasm Note, when setting, QEMU needs to be installed in the Linux kernel with something like: $ docker run --privileged --rm tonistiigi/binfmt --install all Per: https://github.com/docker/buildx --- Makefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index c38f710..00aa895 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,13 @@ # Name of the docker executable DOCKER := $(or $(OCI_EXE), docker) +# The build sub-command. Use: +# +# export "BUILD_CMD=buildx build --platform linux/amd64,linux/arm64" +# +# to generate multi-platform images. +BUILD_CMD := $(or $(BUILD_CMD), build) + # Docker organization to pull the images from ORG = dockcross @@ -118,8 +125,7 @@ $(GEN_IMAGE_DOCKERFILES) Dockerfile: %Dockerfile: %Dockerfile.in $(DOCKER_COMPOS web-wasm: web-wasm/Dockerfile mkdir -p $@/imagefiles && cp -r imagefiles $@/ cp -r test web-wasm/ - $(DOCKER) buildx build -t $(ORG)/web-wasm:$(TAG) \ - --platform linux/amd64,linux/arm64 \ + $(DOCKER) $(BUILD_CMD) -t $(ORG)/web-wasm:$(TAG) \ -t $(ORG)/web-wasm:latest \ --build-arg IMAGE=$(ORG)/web-wasm \ --build-arg VERSION=$(TAG) \