It would be helpful to be able to manage and clean up the docker images on a host from the UI, or even on a schedule basis.
The space in /var/lib/docker will eventually all be used up as more and more docker images are downloaded in order to spin up containers on a host. We need some way to clean up unused images and free up the space. When /var/lib/docker fills up then all sorts of things go wrong that are not immediately obvious, so preemptively managing this would make sense.
If there were a way to click on a host and say "delete all unused images" (or "delete all images not used for X days"), or to schedule this as a daily job, it would be very helpful. Maybe in conjunction with the host disk space monitor, a cleanup of unused images could be triggerred if available space drops below X%.
Of course the rancher/* images would need to be exempt from this as otherwise it takes longer to spin up certain containers, and it might be of use to allow certain images (via an exclude regexp?) to be excluded as well for performance reasons.
At the moment, I have CoreOS set up so that /var/lib/docker is a 16G ephemeral filesystem, so cleanup is just a reboot, but it is not an ideal solution.
+1
Running out of space causes upgrades to churn forever and it's not immediately obvious why. Upgrades should detect inability to download the image and automatically rollback/stop.
And hosts should automatically run sudo docker images -q |xargs sudo docker rmi
once per day.
If you point your Rancher environment at the custom catalogue https://github.com/sshipway/rancher-catalogue.git then there is an item 'Janitor' that does the suggested task, using the meltwater/docker-cleanup container.
It may be easier to do this using a Catalogue item rather than building the functionality directly into Rancher.
This use case/request is a duplicate and covered in https://github.com/rancher/rancher/issues/1277