try to fix script to clean given docker images

This commit is contained in:
cagache
2018-06-28 16:05:46 +03:00
parent 191b7cd021
commit 79b5857d80

View File

@@ -1,11 +1,12 @@
#!/bin/bash #!/bin/bash
set -x set -x
echo $IMAGES_TO_BE_DELETED imagesToBeDeleted=$1
echo $imagesToBeDeleted
echo "List all images:" echo "List all images:"
docker images -a docker images -a
docker_images_list=$(docker images | grep '$IMAGES_TO_BE_DELETED' | awk '{print $3}' | uniq) docker_images_list=$(docker images | grep '$imagesToBeDeleted' | awk '{print $3}' | uniq)
if [ "$docker_images_list" == "" ]; then if [ "$docker_images_list" == "" ]; then
echo "No docker images on the agent" echo "No docker images on the agent"
else else