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!)


-- 
Matthew Miller
<mat...@fedoraproject.org>
Fedora Project Leader
_______________________________________________
golang mailing list
golang@lists.fedoraproject.org
http://lists.fedoraproject.org/admin/lists/golang@lists.fedoraproject.org

Reply via email to