Skip to content
This repository has been archived by the owner on Feb 2, 2021. It is now read-only.

rm_all_dangling: Remove all dangling images and ignore the exclusion … #186

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions docker-gc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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=""
Expand Down