docwhat / docwhat/docker-gc

Persistent storage of recorded data

Open
#5 0 comments 0 reactions 0 assignees View on GitHub
enhancement help wanted
Dominant language
Go
Stars
5
Forks
1
PR merge metrics
No merged PRs in 30d

Description

I've been trying to figure out how to make persistent storage "safe".

In the current model I track a timestamp for when an image was last seen by `docker-gc`. These timestamps are updated when:

* On startup, we scan all images (e.g. `docker image --all`)
* As events mention an image.
* Just prior to deleting old images, all container images are added.

The startup rule causes problems when persisting the state:

1. If we reset all timestamps on startup, then there is no advantage to persisting. All images have their timestamp reset.
2. If we don't, then events could have happened while `docker-gc` wasn't running and it could decide to remove things that are being used.

If we add cleaning of stopped containers (#3) then this gets even more tricky.

Another concern is removing items that aren't in docker anymore (e.g. images that have been `docker rmi`'d).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.