aboutsummaryrefslogtreecommitdiff
path: root/leg-kolla
diff options
context:
space:
mode:
authorMarcin Juszkiewicz <marcin.juszkiewicz@linaro.org>2018-04-24 14:53:11 +0200
committerMarcin Juszkiewicz <marcin.juszkiewicz@linaro.org>2018-04-24 18:32:30 +0200
commitff31382ff2bab3bac0aab4cd3bf36dec1bb537bc (patch)
treeaec4db728fab53b41eb8866d156b595dcafceaa3 /leg-kolla
parent9a3917039cf83e71be8c6ff93b34dfd5d4f60c7d (diff)
leg-kolla*: do whole cleanup in cleanup_exit()
Change-Id: I586cacfe4361b44a31d6497920796188c9e5498e
Diffstat (limited to 'leg-kolla')
-rw-r--r--leg-kolla/build.sh17
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