docker-gc-plus-volumes: docker-gc & docker-cleanup-volumes made easy.
1.1K
dgc - docker-gc-plus-volumesThis repo is just a wrapper script & docker-compose.yml files to make docker container, image, and leftover volume cleanup easy. Contains a couple example container & image exclude files in etc/. Assumes your docker directory is /var/lib/docker, and that the docker daemon socket is located at /var/run/docker.sock.
By default, will delete ALL containers, images, and volumes older than 24 hours and NOT included in the etc/docker-gc-exclude* files. The docker-gc and docker-cleanup-volumes containers & images are also deleted after run.
The wrapper script only accepts a single argument:
--dry-run: Run both docker-gc and docker-cleanup-volumes in DRY RUN mode. Does not actually delete anything.--dry-run, deletion occurs.To run the prebuilt Docker container:
docker run --rm -v /var/lib/docker:/var/lib/docker \
-v /var/run/docker.sock:/var/run/docker.sock \
-v $(pwd)/etc:/etc \
trinitronx/dgc [--dry-run]
To build this docker image:
docker build -t trinitronx/dgc .
See LICENSE.md for full text
Copyright James Cuzella 2014-2016 (@trinitronx)
Author:: James Cuzella (@trinitronx)
Content type
Image
Digest
Size
30.5 MB
Last updated
about 10 years ago
docker pull trinitronx/dgc