Skip to content
프로젝트

Yelp/docker-custodian

GitHub에서 보기

소개

Docker 호스트를 깔끔하게 관리하세요.

시스템 및 인프라

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

Docker Custodian

tests badge docker badge pypi badge

Keep docker hosts tidy.

Install

There are three installation options

Container

docker pull yelp/docker-custodian
docker run -ti \
    -v /var/run/docker.sock:/var/run/docker.sock \
    yelp/docker-custodian --help

Debian/Ubuntu package

First build the package (requires dh-virtualenv)

dpkg-buildpackage -us -uc

Then install it

dpkg -i ../docker-custodian_*.deb

pypi.org

pip install docker-custodian

dcgc

Remove old docker containers and docker images.

dcgc will remove stopped containers and unused images that are older than "max age". Running containers, and images which are used by a container are never removed.

Maximum age can be specificied with any format supported by pytimeparse.

Example:

dcgc --max-container-age 3days --max-image-age 30days

Prevent images from being removed

dcgc supports an image exclude list. If you have images that you'd like to keep around forever you can use the exclude list to prevent them from being removed.

--exclude-image
    Never remove images with this tag. May be specified more than once.

--exclude-image-file
    Path to a file which contains a list of images to exclude, one
    image tag per line.

You also can use basic pattern matching to exclude images with generic tags.

user/repositoryA:*
user/repositoryB:?.?
user/repositoryC-*:tag

Prevent containers and associated images from being removed

dcgc also supports a container exclude list based on labels. If there are stopped containers that you'd like to keep, then you can check the labels to prevent them from being removed.

--exclude-container-label
    Never remove containers that have the label key=value. =value can be
    omitted and in that case only the key is checked. May be specified
    more than once.

You also can use basic pattern matching to exclude generic labels.

foo*
com.docker.compose.project=test*
com.docker*=*bar*

dcstop

Stop containers that have been running for too long.

dcstop will docker stop containers where the container name starts with --prefix and it has been running for longer than --max-run-time.

Example:

dcstop --max-run-time 2days --prefix "projectprefix_"

관련 프로젝트 살펴보기

불러오는 중…