IMG_NAME=buildx-qemu REGISTRY=registry.monotremata.xyz IMG=$(REGISTRY)/$(IMG_NAME) PLATFORMS=linux/amd64,linux/arm64 .PHONY: push buildx clean ARCH=$(shell uname -m) ifeq ($(ARCH),x86_64) TARGETARCH=amd64 else ifeq ($(ARCH),aarch64) TARGETARCH=arm64 else TARGETARCH=amd64 endif out/image-id: Dockerfile entrypoint.sh mkdir -p $(@D) docker build -t $(IMG) --build-arg TARGETARCH=$(TARGETARCH) . echo $(IMG) > $@ push: out/image-id docker image push $(IMG) buildx: Dockerfile entrypoint.sh docker buildx build \ --platform $(PLATFORMS) \ --tag $(IMG) \ --push \ . clean: rm -rf out