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
This commit is contained in:
Matt McCormick 2024-03-25 22:28:04 -04:00
parent ba27b1fc51
commit 50120593a3

View File

@ -6,6 +6,13 @@
# Name of the docker executable # Name of the docker executable
DOCKER := $(or $(OCI_EXE), docker) 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 # Docker organization to pull the images from
ORG = dockcross ORG = dockcross
@ -118,8 +125,7 @@ $(GEN_IMAGE_DOCKERFILES) Dockerfile: %Dockerfile: %Dockerfile.in $(DOCKER_COMPOS
web-wasm: web-wasm/Dockerfile web-wasm: web-wasm/Dockerfile
mkdir -p $@/imagefiles && cp -r imagefiles $@/ mkdir -p $@/imagefiles && cp -r imagefiles $@/
cp -r test web-wasm/ cp -r test web-wasm/
$(DOCKER) buildx build -t $(ORG)/web-wasm:$(TAG) \ $(DOCKER) $(BUILD_CMD) -t $(ORG)/web-wasm:$(TAG) \
--platform linux/amd64,linux/arm64 \
-t $(ORG)/web-wasm:latest \ -t $(ORG)/web-wasm:latest \
--build-arg IMAGE=$(ORG)/web-wasm \ --build-arg IMAGE=$(ORG)/web-wasm \
--build-arg VERSION=$(TAG) \ --build-arg VERSION=$(TAG) \