summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2015-12-29 21:00:39 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2015-12-29 21:00:39 +0100
commit4611eeaabc4889f1d3bf4ae19fe402c4eb08131f (patch)
treee9cfa6e82c746997112f0a4b37443efb82349cac
parent8117c0ae24ea1bc97cb5a04b5e9dfc0b8baf8c9f (diff)
downloaddocker-4611eeaabc4889f1d3bf4ae19fe402c4eb08131f.tar.gz
Remove intermediate containers by default
-rw-r--r--Makefile7
1 files changed, 5 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 59cf7b6..6354364 100644
--- a/Makefile
+++ b/Makefile
@@ -1,10 +1,13 @@
BRANCH := $(shell git rev-parse --abbrev-ref HEAD | sed -e 's/master/latest/g')
NOCACHE := $(shell test 0$(NOCACHE) -eq 0 || echo "--no-cache")
+NORM := $(shell test 0$(NORM) -eq 0 && echo "--rm")
all: docs
for image in $$(find . -mindepth 2 -maxdepth 2 -type f -name "Dockerfile" -exec dirname {} \; | sort); do \
echo "== $$image ==" ; \
- docker build $(NOCACHE) \
+ docker build \
+ $(NOCACHE) \
+ $(NORM) \
-t kolab/$$(basename $$image | sed -r -e 's/[0-9]+-//g'):$(BRANCH) \
$$image/. ; \
docker tag -f kolab/$$(basename $$image | sed -r -e 's/[0-9]+-//g'):$(BRANCH) \
@@ -92,7 +95,7 @@ restart:
done
%:
- docker build $(NOCACHE) -t kolab/$@:$(BRANCH) *-$@
+ docker build $(NOCACHE) $(NORM) -t kolab/$@:$(BRANCH) *-$@
docker tag -f kolab/$@:$(BRANCH) docker.io/kolab/$@:$(BRANCH)
.PHONY: all docs push