This repository was 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
Open
BetaXOi wants to merge 3 commits intospotify:masterfrom
Open
Fix 'EXCLUDE_CONTAINER_IDS_FILE' will not be cleanup if 'EXCLUDE_CONTAINERS_FROM_GC' profile become empty.#178BetaXOi wants to merge 3 commits intospotify:masterfrom
BetaXOi wants to merge 3 commits intospotify:masterfrom
Conversation
added 3 commits
August 31, 2017 09:43
…AINERS_FROM_GC' profile become empty.
EXCLUDE_CREATED=1 means don't clean containers that has been created but never run. EXCLUDE_ALL_IMAGES=1 means only clean containers.
'MINIMUM_CONTAINERS_TO_SAVE=N' means exclude lastest N containers each images.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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