Deleting only images from kolla build

Co-Authored-By: Carlos Cesario <carloscesario@gmail.com>
Change-Id: I3e9652e1cac156f822b388d2b9fd910180b4a892
Closes-Bug: #1551933
This commit is contained in:
Mauricio Lima 2016-05-05 11:43:32 -04:00
parent bde5e732d5
commit 9024564066
2 changed files with 8 additions and 6 deletions

View File

@ -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.

View File

@ -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