diff options
| author | Mauricio Lima <mauriciolimab@gmail.com> | 2016-05-05 11:43:32 -0400 |
|---|---|---|
| committer | Mauricio Lima <mauriciolimab@gmail.com> | 2016-05-05 12:15:04 -0400 |
| commit | 902456406640975b63685e3abc99ec95de336c17 (patch) | |
| tree | 4aa39fdac54a52f1a3d210b640879c492a50f137 /tools/cleanup-images | |
| parent | bde5e732d5c67ef56874a0d85ab5293ba6ce0679 (diff) | |
| download | kolla-ansible-902456406640975b63685e3abc99ec95de336c17.tar.gz kolla-ansible-902456406640975b63685e3abc99ec95de336c17.zip | |
Deleting only images from kolla build
Co-Authored-By: Carlos Cesario <carloscesario@gmail.com>
Change-Id: I3e9652e1cac156f822b388d2b9fd910180b4a892
Closes-Bug: #1551933
Diffstat (limited to 'tools/cleanup-images')
| -rwxr-xr-x | tools/cleanup-images | 10 |
1 files changed, 6 insertions, 4 deletions
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 |
