Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tjamet/caduc
Event based Continuous Docker Cleaner
https://github.com/tjamet/caduc
Last synced: about 1 month ago
JSON representation
Event based Continuous Docker Cleaner
- Host: GitHub
- URL: https://github.com/tjamet/caduc
- Owner: tjamet
- License: gpl-3.0
- Created: 2016-03-28T15:36:06.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-01-07T16:07:50.000Z (almost 6 years ago)
- Last Synced: 2024-07-31T21:57:14.556Z (5 months ago)
- Language: Python
- Homepage:
- Size: 78.1 KB
- Stars: 17
- Watchers: 2
- Forks: 2
- Open Issues: 32
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
- Roadmap: ROADMAP.md
Awesome Lists containing this project
- awesome-docker - caduc - A docker garbage collector cleaning stuff you did not use recently (Development with Docker / Garbage Collection)
- awesome-docker - caduc - A docker garbage collector cleaning stuff you did not use recently (Development with Docker / Garbage Collection)
README
CaDuC
=================================
.. image:: https://travis-ci.org/tjamet/caduc.svg?branch=master
:target: https://travis-ci.org/tjamet/caduc
Caduc watch changes on the docker engine to schedule unused image removal.
A gracetime is observed between the removal of a container and removal of the imageHow To
======Run in a container
------------------As simple as running:
``docker run --rm -ti -v /var/run/docker.sock:/var/run/docker.sock tjamet/caduc``Optionnally, you can provide a configuration file:
``docker run --rm -ti -v /var/run/docker.sock:/var/run/docker.sock -v $HOME/.caduc:/var/run/caduc:ro tjamet/caduc --config-file /var/run/caduc/config.yml``Install
-------Install the tool by launching ``python setup.py install`` as root or ``python setup.py install --user``
If you do not have root acces or do not want to bother your co-workers on the same hostUse
---Setup your environment so that ``docker ps`` returns the list of running containers
To delete images one hour after removal of the last container running them, simply run ``caduc --image-gracetime="1h"``.The default gracetime is of 1 day.
Customize
---------You can customize image grace time, the delay between last container/children layer using the image is deleted
and the actual image removal. This customization can be done per image, matching their tagged name.
To do so, create ``~/.caduc`` directory with a ``config.yml`` file inside it. The matching will be done
by python's `fnmatch function `_.This config file should look like:
images:
:
grace_time:To keep base images stored on your local registry (my.repo.local) 2 days and never delete images pulled
from tjamet on dockerhub, create a config.yml file like this. The delay should be a string matching
`pytimeparse `_.images:
my.repo.local/base/*:
grace_time: 2d
tjamet/*:
grace_time: -1