diff options
author | Jose Lausuch <jose.lausuch@ericsson.com> | 2017-02-22 02:48:11 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2017-02-22 02:48:11 +0000 |
commit | 08ab29d9256d360b3550b79a6de984ae361382f4 (patch) | |
tree | efb8b760bce1dc62c155f250e6849fe5df77cda7 /jjb | |
parent | 9c8c38b62356f91f104c0bcc8a7e9b0e66b3a117 (diff) | |
parent | 7d74359c647fd8950d3f7f28fcc6e49c5587e0f6 (diff) |
Merge "[docker] Use image IDs instead of tags"
Diffstat (limited to 'jjb')
-rw-r--r-- | jjb/releng/opnfv-docker.sh | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/jjb/releng/opnfv-docker.sh b/jjb/releng/opnfv-docker.sh index c906e1fcd..7b93d50bf 100644 --- a/jjb/releng/opnfv-docker.sh +++ b/jjb/releng/opnfv-docker.sh @@ -43,11 +43,11 @@ fi if [[ -n "$(docker images | grep $DOCKER_REPO_NAME)" ]]; then echo "Docker images to remove:" docker images | head -1 && docker images | grep $DOCKER_REPO_NAME - image_tags=($(docker images | grep $DOCKER_REPO_NAME | awk '{print $2}')) - for tag in "${image_tags[@]}"; do - if [[ -n "$(docker images|grep $DOCKER_REPO_NAME|grep $tag)" ]]; then - echo "Removing docker image $DOCKER_REPO_NAME:$tag..." - docker rmi -f $DOCKER_REPO_NAME:$tag + image_ids=($(docker images | grep $DOCKER_REPO_NAME | awk '{print $3}')) + for id in "${image_ids[@]}"; do + if [[ -n "$(docker images|grep $DOCKER_REPO_NAME|grep $id)" ]]; then + echo "Removing docker image $DOCKER_REPO_NAME:$id..." + docker rmi -f $id fi done fi |