diff options
author | Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org> | 2018-04-24 14:53:11 +0200 |
---|---|---|
committer | Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org> | 2018-04-24 18:32:30 +0200 |
commit | ff31382ff2bab3bac0aab4cd3bf36dec1bb537bc (patch) | |
tree | aec4db728fab53b41eb8866d156b595dcafceaa3 /leg-kolla | |
parent | 9a3917039cf83e71be8c6ff93b34dfd5d4f60c7d (diff) |
leg-kolla*: do whole cleanup in cleanup_exit()
Change-Id: I586cacfe4361b44a31d6497920796188c9e5498e
Diffstat (limited to 'leg-kolla')
-rw-r--r-- | leg-kolla/build.sh | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/leg-kolla/build.sh b/leg-kolla/build.sh index 874a6712..b2167aa8 100644 --- a/leg-kolla/build.sh +++ b/leg-kolla/build.sh @@ -25,6 +25,15 @@ trap cleanup_exit INT TERM EXIT cleanup_exit() { rm -rf ${HOME}/.docker + + docker images | grep ${kolla_tag} | sort + + # remove all images as they are pushed to hub.docker.com and won't be used + # do in a loop as we remove in random order and some have children images + for run in 1 2 3 4 5 + do + docker images | grep ${kolla_tag} | awk '{print $3}' | xargs docker rmi -f 2>&1 >/dev/null || true + done } mkdir -p ${HOME}/.docker @@ -64,11 +73,3 @@ kolla_namespace=linaro --type source \ --namespace ${kolla_namespace} || true -docker images | grep ${kolla_tag} | sort - -# remove all images as they are pushed to hub.docker.com and won't be used -# do in a loop as we remove in random order and some have children images -for run in 1 2 3 4 5 -do - docker images | grep ${kolla_tag} | awk '{print $3}' | xargs docker rmi -f 2>&1 >/dev/null || true -done |