The missing garbage collector for docker
I have pre-built binaries for several platform already. They are available on the releases page.
I also have pre-built containers available on Docker Hub.
You can use this via docker run
:
$ docker run -d -v /var/run/docker:/var/run/docker --name=gc docwhat/docker-gc:latest
If you have go installed, then you can get the binary docker-gc
with the following command:
$ go get -u -v github.com/docwhat/docker-gc
usage: docker-gc_darwin_amd64 [<flags>]
The missing docker garbage collector.
Flags:
-h, --help Show context-sensitive help (also try --help-long
and --help-man).
--version Show application version.
-m, --max-image-age=168h How old to allow images to be before deletion. (Env:
DOCKER_GC_MAX_IMAGE_AGE)
-s, --sweeper-time=15m How much time between running checks to delete
images. (Env: DOCKER_GC_SWEEPER_TIME)
-d, --dangle-safe-duration=30m
How old should a dangle image be before deletion.
(Env: DOCKER_GC_DANGLE_SAFE_DURATION)
-q, --quiet Don't show any output. (Env: DOCKER_GC_QUIET)
It uses the normal Docker environment variables, so if docker info
works, then docker-gc
should work.
I love contributions! Read CONTRIBUTING.md for details.