summaryrefslogtreecommitdiffstats
path: root/ci/build_rpm/build_rpms.sh
diff options
context:
space:
mode:
authorAlex Yang <yangyang1@zte.com.cn>2017-01-03 11:37:21 +0800
committerAlex Yang <yangyang1@zte.com.cn>2017-01-03 11:53:36 +0800
commitdc919f8142fc47b60238d4983c564fc98a45265a (patch)
tree7a2a54d0ffe00d88a68a11818394d72e5380837b /ci/build_rpm/build_rpms.sh
parente77f23d3483621c52c1c2e25e9a0017ff1126ccd (diff)
Fix bug in removing docker containers and images
1. "unexpected unclosed action in range" occurs in "docker inspect -f $ops ..." 2. "No such image" occurs in "docker rmi ..." Change-Id: I1a1ae9441beb3739585c8f2dcb63029b16c0c2fe Signed-off-by: Alex Yang <yangyang1@zte.com.cn>
Diffstat (limited to 'ci/build_rpm/build_rpms.sh')
-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"