From e50f5c52c54c344d5bc2a1da24646990d6d69eea Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Mon, 31 Oct 2016 10:56:18 +0000 Subject: [PATCH] Make templating of Dockerfiles more generic --- .gitignore | 2 +- Makefile | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index d8b672d8..ea82d605 100644 --- a/.gitignore +++ b/.gitignore @@ -43,7 +43,7 @@ prog/weavewait/weavewait prog/weavewait/weavewait_noop prog/weavewait/weavewait_nomcast prog/weaveutil/weaveutil -prog/plugin/Dockerfile.* +prog/*/Dockerfile.weaveworks prog/plugin/plugin testing/cover/cover testing/runner/runner diff --git a/Makefile b/Makefile index 8f58161f..1f3b5525 100644 --- a/Makefile +++ b/Makefile @@ -128,6 +128,9 @@ $(BUILD_UPTODATE): build/* $(SUDO) docker build -t $(BUILD_IMAGE) build/ touch $@ +%/Dockerfile.$(DOCKERHUB_USER): %/Dockerfile.template + sed -e "s/DOCKERHUB_USER/$(DOCKERHUB_USER)/" $^ > $@ + $(WEAVER_UPTODATE): prog/weaver/Dockerfile $(WEAVER_EXE) $(SUDO) DOCKER_HOST=$(DOCKER_HOST) docker build -t $(WEAVER_IMAGE) prog/weaver touch $@ @@ -144,9 +147,6 @@ $(WEAVEEXEC_UPTODATE): prog/weaveexec/Dockerfile prog/weaveexec/symlink $(DOCKER $(SUDO) DOCKER_HOST=$(DOCKER_HOST) docker build -t $(WEAVEEXEC_IMAGE) prog/weaveexec touch $@ -prog/plugin/Dockerfile.$(DOCKERHUB_USER): prog/plugin/Dockerfile.template - sed -e "s/DOCKERHUB_USER/$(DOCKERHUB_USER)/" $^ > $@ - $(PLUGIN_UPTODATE): prog/plugin/Dockerfile.$(DOCKERHUB_USER) $(PLUGIN_EXE) $(WEAVEEXEC_UPTODATE) $(SUDO) docker build -f prog/plugin/Dockerfile.$(DOCKERHUB_USER) -t $(PLUGIN_IMAGE) prog/plugin touch $@