cleanup dangling images on make rm
Change-Id: Iab64acda90bf5de29732ff6c1b4bdc4361370f42
diff --git a/cord-pod/Makefile b/cord-pod/Makefile
index 7193032..55ab1a4 100644
--- a/cord-pod/Makefile
+++ b/cord-pod/Makefile
@@ -173,6 +173,7 @@
rm: stop
test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) rm -f
sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) rm -f
+ [ -n "$(shell docker images -f \"dangling=true\" -q)" ] && docker rmi $(shell docker images -f "dangling=true" -q) || true
showlogs:
sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) logs
diff --git a/devel/Makefile b/devel/Makefile
index d4d9291..416eb51 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -82,6 +82,7 @@
rm: stop
test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) rm -f
sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) rm -f
+ [ -n "$(shell docker images -f \"dangling=true\" -q)" ] && docker rmi $(shell docker images -f "dangling=true" -q) || true
ps:
sudo MYIP=$(MYIP) docker-compose ps
diff --git a/frontend/Makefile b/frontend/Makefile
index 128cc87..b0f02c8 100644
--- a/frontend/Makefile
+++ b/frontend/Makefile
@@ -74,6 +74,7 @@
rm: stop
test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) rm -f
sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) rm -f
+ [ -n "$(shell docker images -f \"dangling=true\" -q)" ] && docker rmi $(shell docker images -f "dangling=true" -q) || true
ps:
sudo docker-compose ps
diff --git a/test-standalone/Makefile b/test-standalone/Makefile
index ffbe368..ee3a206 100644
--- a/test-standalone/Makefile
+++ b/test-standalone/Makefile
@@ -139,6 +139,7 @@
rm: stop
test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) rm -f
sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) rm -f
+ [ -n "$(shell docker images -f \"dangling=true\" -q)" ] && docker rmi $(shell docker images -f "dangling=true" -q) || true
docker-clean:
sudo docker rm -f $(shell sudo docker ps -aq)