aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMauricio Lima <mauriciolimab@gmail.com>2016-05-05 11:43:32 -0400
committerMauricio Lima <mauriciolimab@gmail.com>2016-05-05 12:15:04 -0400
commit902456406640975b63685e3abc99ec95de336c17 (patch)
tree4aa39fdac54a52f1a3d210b640879c492a50f137
parentbde5e732d5c67ef56874a0d85ab5293ba6ce0679 (diff)
downloadkolla-902456406640975b63685e3abc99ec95de336c17.tar.gz
kolla-902456406640975b63685e3abc99ec95de336c17.zip
Deleting only images from kolla build
Co-Authored-By: Carlos Cesario <carloscesario@gmail.com> Change-Id: I3e9652e1cac156f822b388d2b9fd910180b4a892 Closes-Bug: #1551933
-rw-r--r--doc/operating-kolla.rst4
-rwxr-xr-xtools/cleanup-images10
2 files changed, 8 insertions, 6 deletions
diff --git a/doc/operating-kolla.rst b/doc/operating-kolla.rst
index dde9178ff..37ce96e2b 100644
--- a/doc/operating-kolla.rst
+++ b/doc/operating-kolla.rst
@@ -32,5 +32,5 @@ triggered on the Docker host when the neutron-agents containers are launched.
This can be useful when you want to do a new clean deployment, particularly
one changing the network topology.
-``tools/cleanup-images`` can be used to remove all Docker images from the
-local Docker cache. Note: this will remove the registry also.
+``tools/cleanup-images`` can be used to remove all Docker images built by
+Kolla from the local Docker cache.
diff --git a/tools/cleanup-images b/tools/cleanup-images
index 065005220..26073c5bf 100755
--- a/tools/cleanup-images
+++ b/tools/cleanup-images
@@ -4,11 +4,13 @@
REAL_PATH=$(python -c "import os,sys;print os.path.realpath('$0')")
cd "$(dirname "$REAL_PATH")/.."
-. tools/validate-docker-execute.sh
+. tools/validate-docker-execute
-IMAGES=`docker images -a -q`
-if [[ -z "$IMAGES" ]]; then
+KOLLA_IMAGES=$(docker images -a --filter "label=kolla_version" --format "{{.ID}}")
+
+if [[ -z "$KOLLA_IMAGES" ]]; then
echo "No images to cleanup, exit now."
exit 0
fi
-docker rmi $@ $IMAGES
+
+docker rmi $@ $KOLLA_IMAGES