docker free space follow up (still not complete, but getting there)
So this is in a much better shape:
it listens to docker events to get the image count- it uses https://gitlab.freedesktop.org/freedesktop/fdo-containers-usage to get the image count
- if the disk size is lower than the target, after a docker events comes in, it would clean up containers and images
- containers are cleaned up by their latest used timestamp
- images are cleaned up by their latest usage count and time
There are still a few functionalities missing before we can use it:
properly update the image list and count (right now it is only created at launch, so this will get inaccurate)properly update the container list (likewise)- assign a better ratio between containers and image cleaning (both are currently freeing the space between the start of the cleaning and the target, so we get twice the required space that is freed)
- speed up the container size computation (we can simply use the effective space freed on the disk instead of pre-computing the size of the volume directory)
- handle a
SIG_USER
to dump the current image refcounts - create the systemd service file
- rule the world
Edited by Benjamin Tissoires