aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorRichard Mortier <mort@cantab.net>2019-03-22 18:01:14 +0000
committerRichard Mortier <mort@cantab.net>2019-03-22 18:01:14 +0000
commitc01bf6a5d4ac1640dbe3546cb77c2f3d61b56b74 (patch)
treeb35f489af18f1cfcb02824d93e55650a55becb98 /Makefile
parentd6457141fa1cccb24ac8a1bfa35a143265ba7aeb (diff)
downloaddocker-abuild-c01bf6a5d4ac1640dbe3546cb77c2f3d61b56b74.tar.bz2
docker-abuild-c01bf6a5d4ac1640dbe3546cb77c2f3d61b56b74.tar.xz
make: template `Dockerfile` to support different Alpine versions
Signed-off-by: Richard Mortier <mort@cantab.net>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile18
1 files changed, 16 insertions, 2 deletions
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