This repository has been archived by the owner on Feb 2, 2021. It is now read-only.
Fix 'EXCLUDE_CONTAINER_IDS_FILE' will not be cleanup if 'EXCLUDE_CONTAINERS_FROM_GC' profile become empty. #178
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
cleanup 'STATE_DIR' and show docker containers and images info.
# rm -rf /var/lib/docker-gc/
# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
alpine latest 7328f6f8b418 9 weeks ago 3.962 MB
# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
95bebd030e6c alpine "sh" 16 hours ago Exited (0) 16 hours ago focused_panini
find out containers and images can be deleted.
# > /etc/docker-gc-exclude-containers
# DRY_RUN=1 ./docker-gc
[2017-08-31T09:59:15] [INFO] : Container not running 95bebd030e6c1016314551c7966c8a5479cfc5a3005c8c5e8d4d4f1efe9df151 /focused_panini
[2017-08-31T09:59:15] [INFO] : The following container would have been removed 95bebd030e6c1016314551c7966c8a5479cfc5a3005c8c5e8d4d4f1efe9df151 /focused_panini
[2017-08-31T09:59:15] [INFO] : The following image would have been removed sha256:7328f6f8b41890597575cbaadc884e7386ae0acc53b747401ebce5cf0d624560 [alpine:latest]
add container '95bebd030e6c' to exclusion.
# echo 95bebd030e6c > /etc/docker-gc-exclude-containers
# DRY_RUN=1 ./docker-gc
[2017-08-31T09:59:46] [INFO] : Container not running 95bebd030e6c1016314551c7966c8a5479cfc5a3005c8c5e8d4d4f1efe9df151 /focused_panini
'95bebd030e6c' is still in 'EXCLUDE_CONTAINER_IDS_FILE' after cleanup 'EXCLUDE_CONTAINERS_FROM_GC' profile.
# > /etc/docker-gc-exclude-containers
# DRY_RUN=1 ./docker-gc
[2017-08-31T09:59:59] [INFO] : Container not running 95bebd030e6c1016314551c7966c8a5479cfc5a3005c8c5e8d4d4f1efe9df151 /focused_panini
# cat /var/lib/docker-gc/exclude_container_ids
95bebd030e6c