dockerfiles/syncthing/Makefile

32 lines
634 B
Makefile
Raw Normal View History

2020-04-08 13:05:07 +02:00
IMG_NAME = syncthing
2022-05-25 11:34:36 +02:00
REGISTRY=registry.monotremata.xyz
2022-03-07 13:55:05 +01:00
IMG=$(REGISTRY)/$(IMG_NAME)
2022-05-25 11:34:36 +02:00
PLATFORMS=linux/amd64,linux/arm64
2022-03-07 13:55:05 +01:00
2022-05-25 11:34:36 +02:00
.PHONY: build build-nc buildx push
2020-04-08 13:05:07 +02:00
hw=$(shell uname -m)
ifeq ($(hw), x86_64)
2022-05-25 11:34:36 +02:00
TARGETPLATFORM=linux/amd64
2020-04-08 13:05:07 +02:00
else ifeq ($(hw), aarch64)
2022-05-25 11:34:36 +02:00
TARGETPLATFORM=linux/arm64
2020-04-08 13:05:07 +02:00
else
2022-05-25 11:34:36 +02:00
TARGETPLATFORM=linux/$(hw)
2020-04-08 13:05:07 +02:00
endif
2022-05-25 11:34:36 +02:00
build: Dockerfile
docker build -t $(IMG) --build-arg TARGETPLATFORM=$(TARGETPLATFORM) .
buildx: Dockerfile
docker buildx build \
--platform $(PLATFORMS) \
--tag $(IMG) \
--push \
.
2022-03-07 13:55:05 +01:00
push: build
docker image push $(IMG)
2020-04-08 13:05:07 +02:00
2022-05-25 11:34:36 +02:00
build-nc: Dockerfile
2022-03-07 13:55:05 +01:00
docker build --no-cache -t $(IMG) --build-arg ARCH=$(ARCH) .