summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhijiang Hu <hu.zhijiang@zte.com.cn>2017-01-03 08:01:59 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-01-03 08:01:59 +0000
commit6a7ad4ebcc7c0b0a5c2c5935410d818999bec5a5 (patch)
tree2afcbd22b171d1c01be63e892c6183ad07300b71
parent09f9c88c999e3d6b2e2c88c29f505bb39b8fbc19 (diff)
parentdc919f8142fc47b60238d4983c564fc98a45265a (diff)
Merge "Fix bug in removing docker containers and images"
-rwxr-xr-xci/build_rpm/build_rpms.sh5
1 files changed, 2 insertions, 3 deletions
diff --git a/ci/build_rpm/build_rpms.sh b/ci/build_rpm/build_rpms.sh
index e0472a24..48a87236 100755
--- a/ci/build_rpm/build_rpms.sh
+++ b/ci/build_rpm/build_rpms.sh
@@ -33,7 +33,7 @@ function cleanup_container {
if [[ ! -z "$containers_to_kill" ]]; then
ops='{{range .Mounts}} {{printf "%s\n" .Name }}{{end}}'
volumes_to_remove=$(sudo docker inspect -f \
- $ops ${containers_to_kill} \
+ "$ops" ${containers_to_kill} \
| egrep -v '(^\s*$)' \
| sort | uniq)
@@ -47,8 +47,7 @@ function cleanup_container {
}
function cleanup_docker_image {
- images_to_delete=$(sudo docker images -a \
- --format "{{.ID}}" \
+ images_to_delete=$(sudo docker images -q \
--filter "label=daisy_image_version")
echo "Removing images... $images_to_delete"