2020-03-21 11:50:28 +00:00
|
|
|
---
|
|
|
|
title: docker_tidy
|
|
|
|
type: docs
|
|
|
|
---
|
|
|
|
|
|
|
|
[![Source Code](https://img.shields.io/badge/gitea-source%20code-blue?logo=gitea&logoColor=white)](https://gitea.rknet.org/ansible/xoxys.docker_tidy) [![Build Status](https://img.shields.io/drone/build/ansible/xoxys.docker_tidy?logo=drone&server=https%3A%2F%2Fdrone.rknet.org)](https://drone.rknet.org/ansible/xoxys.docker_tidy) [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
|
|
|
|
|
|
|
|
Setup docker-tidy garbage collector. Keep docker hosts small.
|
|
|
|
|
|
|
|
* [Default Variables](#default-variables)
|
2020-03-21 13:09:33 +00:00
|
|
|
* [dockertidy_dangling_volumes](#dockertidy-dangling-volumes)
|
|
|
|
* [dockertidy_docker_socket_path](#dockertidy-docker-socket-path)
|
|
|
|
* [dockertidy_dry_run](#dockertidy-dry-run)
|
|
|
|
* [dockertidy_exclude_container_label](#dockertidy-exclude-container-label)
|
|
|
|
* [dockertidy_exclude_container_labels](#dockertidy-exclude-container-labels)
|
|
|
|
* [dockertidy_exclude_image](#dockertidy-exclude-image)
|
|
|
|
* [dockertidy_exclude_images](#dockertidy-exclude-images)
|
|
|
|
* [dockertidy_image](#dockertidy-image)
|
|
|
|
* [dockertidy_interval](#dockertidy-interval)
|
|
|
|
* [dockertidy_log_level](#dockertidy-log-level)
|
|
|
|
* [dockertidy_max_container_age](#dockertidy-max-container-age)
|
|
|
|
* [dockertidy_max_image_age](#dockertidy-max-image-age)
|
2020-03-21 11:50:28 +00:00
|
|
|
* [Dependencies](#dependencies)
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
## Default Variables
|
|
|
|
|
2020-03-21 13:09:33 +00:00
|
|
|
### dockertidy_dangling_volumes
|
2020-03-21 11:50:28 +00:00
|
|
|
|
2020-03-21 13:09:33 +00:00
|
|
|
Remove dangling volumes.
|
2020-03-21 11:50:28 +00:00
|
|
|
|
|
|
|
#### Default value
|
|
|
|
|
|
|
|
```YAML
|
2020-03-21 13:09:33 +00:00
|
|
|
dockertidy_dangling_volumes: false
|
2020-03-21 11:50:28 +00:00
|
|
|
```
|
|
|
|
|
2020-03-21 13:09:33 +00:00
|
|
|
### dockertidy_docker_socket_path
|
2020-03-21 11:50:28 +00:00
|
|
|
|
2020-03-21 13:09:33 +00:00
|
|
|
#### Default value
|
|
|
|
|
|
|
|
```YAML
|
|
|
|
dockertidy_docker_socket_path: /var/run/docker.sock
|
|
|
|
```
|
|
|
|
|
|
|
|
### dockertidy_dry_run
|
|
|
|
|
|
|
|
Only log actions, don't cleanup anything.
|
|
|
|
|
|
|
|
#### Default value
|
|
|
|
|
|
|
|
```YAML
|
|
|
|
dockertidy_dry_run: false
|
|
|
|
```
|
|
|
|
|
|
|
|
### dockertidy_exclude_container_label
|
|
|
|
|
|
|
|
Never remove containers with this label `key` or label `key=value`.
|
|
|
|
|
|
|
|
### dockertidy_exclude_container_labels
|
|
|
|
|
|
|
|
#### Default value
|
|
|
|
|
|
|
|
```YAML
|
|
|
|
dockertidy_exclude_container_labels: []
|
|
|
|
```
|
|
|
|
|
|
|
|
### dockertidy_exclude_image
|
|
|
|
|
|
|
|
Never remove images with this tag.
|
|
|
|
|
|
|
|
### dockertidy_exclude_images
|
2020-03-21 11:50:28 +00:00
|
|
|
|
|
|
|
#### Default value
|
|
|
|
|
|
|
|
```YAML
|
2020-03-21 13:09:33 +00:00
|
|
|
dockertidy_exclude_images: []
|
2020-03-21 11:50:28 +00:00
|
|
|
```
|
|
|
|
|
2020-03-21 13:09:33 +00:00
|
|
|
### dockertidy_image
|
2020-03-21 11:50:28 +00:00
|
|
|
|
2020-03-21 13:09:33 +00:00
|
|
|
Docker image to use.
|
2020-03-21 11:50:28 +00:00
|
|
|
|
|
|
|
#### Default value
|
|
|
|
|
|
|
|
```YAML
|
2020-03-21 13:09:33 +00:00
|
|
|
dockertidy_image: xoxys/docker-tidy:latest
|
2020-03-21 11:50:28 +00:00
|
|
|
```
|
|
|
|
|
2020-03-21 13:09:33 +00:00
|
|
|
### dockertidy_interval
|
2020-03-21 11:50:28 +00:00
|
|
|
|
2020-03-21 13:09:33 +00:00
|
|
|
Interval for the systemd timer.
|
2020-03-21 11:50:28 +00:00
|
|
|
|
|
|
|
#### Default value
|
|
|
|
|
|
|
|
```YAML
|
2020-03-21 13:09:33 +00:00
|
|
|
dockertidy_interval: daily
|
2020-03-21 11:50:28 +00:00
|
|
|
```
|
|
|
|
|
2020-03-21 13:09:33 +00:00
|
|
|
### dockertidy_log_level
|
2020-03-21 11:50:28 +00:00
|
|
|
|
2020-03-21 13:09:33 +00:00
|
|
|
Current log level.
|
2020-03-21 11:50:28 +00:00
|
|
|
|
|
|
|
#### Default value
|
|
|
|
|
|
|
|
```YAML
|
2020-03-21 13:09:33 +00:00
|
|
|
dockertidy_log_level: warning
|
2020-03-21 11:50:28 +00:00
|
|
|
```
|
|
|
|
|
2020-03-21 13:09:33 +00:00
|
|
|
### dockertidy_max_container_age
|
2020-03-21 11:50:28 +00:00
|
|
|
|
2020-03-21 13:09:33 +00:00
|
|
|
Maximum age for a container, containers older than this age will be removed.
|
2020-03-21 11:50:28 +00:00
|
|
|
|
|
|
|
#### Default value
|
|
|
|
|
|
|
|
```YAML
|
2020-03-21 13:09:33 +00:00
|
|
|
dockertidy_max_container_age: 5 days ago
|
2020-03-21 11:50:28 +00:00
|
|
|
```
|
|
|
|
|
2020-03-21 13:09:33 +00:00
|
|
|
### dockertidy_max_image_age
|
2020-03-21 11:50:28 +00:00
|
|
|
|
2020-03-21 13:09:33 +00:00
|
|
|
Maxium age for an image, images older than this age will be removed.
|
2020-03-21 11:50:28 +00:00
|
|
|
|
|
|
|
#### Default value
|
|
|
|
|
|
|
|
```YAML
|
2020-03-21 13:09:33 +00:00
|
|
|
dockertidy_max_image_age: 3 days ago
|
2020-03-21 11:50:28 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
## Dependencies
|
|
|
|
|
|
|
|
None.
|