From 394f92f76e3671fac6cef168434bfedd0913254b Mon Sep 17 00:00:00 2001 From: Andy Hibbert Date: Tue, 30 Jan 2018 18:12:26 +0000 Subject: [PATCH] rm_all_dangling: Remove all dangling images and ignore the exclusion file Change-Id: I6a240a4123689b6fd02b11d193eac75700798cf8 --- docker-gc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker-gc b/docker-gc index cd7a511..1cbcf20 100755 --- a/docker-gc +++ b/docker-gc @@ -254,9 +254,6 @@ do | uniq >> images.all done -# Add dangling images to list. -$DOCKER images --no-trunc --format "{{.ID}}" --filter dangling=true >> images.all - # Find images that are created at least GRACE_PERIOD_SECONDS ago > images.reap.tmp cat images.all | sort | uniq | while read line @@ -269,6 +266,9 @@ do done comm -23 images.reap.tmp images.used | grep -E -v -f $EXCLUDE_IDS_FILE > images.reap || true +# Remove dangling images and do not exclude them +$DOCKER images --no-trunc --format "{{.ID}}" --filter dangling=true >> images.reap + # Use -f flag on docker rm command; forces removal of images that are in Dead # status or give errors when removing. FORCE_CONTAINER_FLAG=""