From c01bf6a5d4ac1640dbe3546cb77c2f3d61b56b74 Mon Sep 17 00:00:00 2001 From: Richard Mortier Date: Fri, 22 Mar 2019 18:01:14 +0000 Subject: make: template `Dockerfile` to support different Alpine versions Signed-off-by: Richard Mortier --- Makefile | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index b69fb42..a6f00a0 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,21 @@ +TAGS := $(shell \ + curl -s https://registry.hub.docker.com/v1/repositories/alpine/tags \ + | jq -r '.[].name' \ +) + .PHONY: build -build: - DOCKER_BUILDKIT=1 docker build $(DOCKER_FLAGS) -t mor1/abuild . +build: $(patsubst %, build-%, $(TAGS)) + +.PHONY: build-% +build-%: + sed 's/%%ALPINE_TAG%%/$*/' Dockerfile.in >| Dockerfile + DOCKER_BUILDKIT=1 docker build $$DOCKER_FLAGS -t mor1/abuild:$* . + $(RM) Dockerfile .PHONY: push push: build docker push $(DOCKER_FLAGS) mor1/abuild + +.PHONY: clean +clean: + $(RM) Dockerfile -- cgit v1.3