diff --git a/common_functions.sh b/common_functions.sh index 642c73c67..fb5f6b8be 100755 --- a/common_functions.sh +++ b/common_functions.sh @@ -165,7 +165,10 @@ function cleanup_images() { docker container prune -f 2>/dev/null # Delete any old images for our target_repo on localhost. - docker rmi -f "$(docker images | grep -e 'adoptopenjdk' | awk -v OFS=':' '{ print $1, $2 }')" 2>/dev/null + for image in $(docker images | grep -e 'adoptopenjdk' | awk -v OFS=':' '{ print $1, $2 }'); + do + docker rmi -f "${image}"; + done # Remove any dangling images docker image prune -f 2>/dev/null