Public | Automated Build

Last pushed: a year ago
Short Description
docker-gc-plus-volumes: docker-gc & docker-cleanup-volumes made easy.
Full Description

dgc - docker-gc-plus-volumes




This 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.

Usage

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.
  • When run WITHOUT --dry-run, deletion occurs.

Docker

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]

Build

To build this docker image:

docker build -t trinitronx/dgc .

License

GNU GPL v3

See LICENSE.md for full text

Copyright

Copyright James Cuzella 2014-2016 (@trinitronx)

Author

Author:: James Cuzella (@trinitronx)

Docker Pull Command
Owner
trinitronx