See: https://github.com/spotify/docker-gc
A simple Docker container and image garbage collection script.
Containers that exited more than an hour ago are removed.
Images that don't belong to any remaining container after that are removed.
Although docker normally prevents removal of images that are in use by containers, we take extra care to not remove any image tags (e.g., ubuntu:14.04, busybox, etc) that are in use by containers. A naive docker rmi $(docker images -q) will leave images stripped of all tags, forcing docker to re-pull the repositories when starting new containers even though the images themselves are still on disk.
This script is intended to be run as a cron job, but you can also run it as a Docker container (see below).
I had ambitions of packaging this myself, but taking a look at the calendar, that doesn't seem reasonable. Anyone else want to take a stab? (Bonus points -- a PR for github to include RPM-building instructions!)
Give it to me :). Any deadline?
On 04/11/2016 06:36 PM, Matthew Miller wrote:
See: https://github.com/spotify/docker-gc
A simple Docker container and image garbage collection script.
Containers that exited more than an hour ago are removed. Images that don't belong to any remaining container after that are removed.Although docker normally prevents removal of images that are in use by containers, we take extra care to not remove any image tags (e.g., ubuntu:14.04, busybox, etc) that are in use by containers. A naive docker rmi $(docker images -q) will leave images stripped of all tags, forcing docker to re-pull the repositories when starting new containers even though the images themselves are still on disk.
This script is intended to be run as a cron job, but you can also run it as a Docker container (see below).
I had ambitions of packaging this myself, but taking a look at the calendar, that doesn't seem reasonable. Anyone else want to take a stab? (Bonus points -- a PR for github to include RPM-building instructions!)
Can't find any go source code files :(. The github is all it is or is there any other source of codes?
On 04/11/2016 06:37 PM, Jan Chaloupka wrote:
Give it to me :). Any deadline?
On 04/11/2016 06:36 PM, Matthew Miller wrote:
See: https://github.com/spotify/docker-gc
A simple Docker container and image garbage collection script.
Containers that exited more than an hour ago are removed. Images that don't belong to any remaining container after that are removed.Although docker normally prevents removal of images that are in use by containers, we take extra care to not remove any image tags (e.g., ubuntu:14.04, busybox, etc) that are in use by containers. A naive docker rmi $(docker images -q) will leave images stripped of all tags, forcing docker to re-pull the repositories when starting new containers even though the images themselves are still on disk.
This script is intended to be run as a cron job, but you can also run it as a Docker container (see below).
I had ambitions of packaging this myself, but taking a look at the calendar, that doesn't seem reasonable. Anyone else want to take a stab? (Bonus points -- a PR for github to include RPM-building instructions!)
golang mailing list golang@lists.fedoraproject.org http://lists.fedoraproject.org/admin/lists/golang@lists.fedoraproject.org
It is a single shell script:
https://github.com/spotify/docker-gc/blob/master/docker-gc
On Mon, Apr 11, 2016 at 11:40 AM, Jan Chaloupka jchaloup@redhat.com wrote:
Can't find any go source code files :(. The github is all it is or is there any other source of codes?
On 04/11/2016 06:37 PM, Jan Chaloupka wrote:
Give it to me :). Any deadline?
On 04/11/2016 06:36 PM, Matthew Miller wrote:
See: https://github.com/spotify/docker-gc
A simple Docker container and image garbage collection script.
Containers that exited more than an hour ago are removed. Images that don't belong to any remaining container after that are removed.Although docker normally prevents removal of images that are in use by containers, we take extra care to not remove any image tags (e.g., ubuntu:14.04, busybox, etc) that are in use by containers. A naive docker rmi $(docker images -q) will leave images stripped of all tags, forcing docker to re-pull the repositories when starting new containers even though the images themselves are still on disk.
This script is intended to be run as a cron job, but you can also run it as a Docker container (see below).
I had ambitions of packaging this myself, but taking a look at the calendar, that doesn't seem reasonable. Anyone else want to take a stab? (Bonus points -- a PR for github to include RPM-building instructions!)
golang mailing list golang@lists.fedoraproject.org http://lists.fedoraproject.org/admin/lists/golang@lists.fedoraproject.org
golang mailing list golang@lists.fedoraproject.org http://lists.fedoraproject.org/admin/lists/golang@lists.fedoraproject.org
On Mon, Apr 11, 2016 at 02:42:21PM -0500, Jeff Schroeder wrote:
It is a single shell script: https://github.com/spotify/docker-gc/blob/master/docker-gc
Hah! Why so it is. I followed from somewhere else that was Go-centric, and just assumed that it was Go without, clearly, looking very deeply. Jan Chaloupka, in this case, I can probably find a few minutes to package it up myself.
Maybe after I get some apparently much-needed sleep. :)
On Mon, Apr 11, 2016 at 06:40:46PM +0200, Jan Chaloupka wrote:
Can't find any go source code files :(. The github is all it is or is there any other source of codes?
Welcome to the modern world! :-/
On Mon, Apr 11, 2016 at 06:37:43PM +0200, Jan Chaloupka wrote:
Give it to me :). Any deadline?
Nope — just would be useful.
golang@lists.fedoraproject.org