https://github.com/trinitronx/docker-gc-plus-volumes
docker-gc & docker-cleanup-volumes made easy
https://github.com/trinitronx/docker-gc-plus-volumes
Last synced: 11 months ago
JSON representation
docker-gc & docker-cleanup-volumes made easy
- Host: GitHub
- URL: https://github.com/trinitronx/docker-gc-plus-volumes
- Owner: trinitronx
- License: gpl-3.0
- Created: 2016-07-21T17:42:44.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2018-01-30T23:49:15.000Z (over 8 years ago)
- Last Synced: 2025-01-10T07:47:22.111Z (over 1 year ago)
- Language: Shell
- Homepage:
- Size: 31.3 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
`dgc` - docker-gc-plus-volumes
==============================
[](https://hub.docker.com/r/trinitronx/dgc)
[](https://hub.docker.com/r/trinitronx/dgc) [](https://microbadger.com/images/trinitronx/dgc "Get your own image badge on microbadger.com")
[](https://github.com/trinitronx/docker-gc-plus-volumes/releases)
[](https://www.gittip.com/trinitronx)
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](http://choosealicense.com/licenses/gpl-3.0/)
See LICENSE.md for full text
Copyright
=========
Copyright James Cuzella 2014-2016 ([@trinitronx][keybase-id])
Author
======
Author:: James Cuzella ([@trinitronx][keybase-id])
[keybase-id]: https://gist.github.com/trinitronx/aee110cbdf55e67185dc44272784e694