dockerfiles/buildx-qemu/Makefile

35 lines
619 B
Makefile
Raw Normal View History

2022-08-16 22:57:31 +02:00
IMG_NAME=buildx-qemu
REGISTRY=registry.monotremata.xyz
IMG=$(REGISTRY)/$(IMG_NAME)
PLATFORMS=linux/amd64,linux/arm64
.PHONY: push buildx clean
2022-08-16 22:57:31 +02:00
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)
2022-08-16 22:57:31 +02:00
docker build -t $(IMG) --build-arg TARGETARCH=$(TARGETARCH) .
echo $(IMG) > $@
2022-08-16 22:57:31 +02:00
push: out/image-id
2022-08-16 22:57:31 +02:00
docker image push $(IMG)
buildx: Dockerfile entrypoint.sh
docker buildx build \
--platform $(PLATFORMS) \
--tag $(IMG) \
--push \
.
clean:
rm -rf out