2020-03-15 12:21:36 +00:00
|
|
|
---
|
|
|
|
title: Configuration
|
|
|
|
---
|
|
|
|
|
2020-06-07 14:54:30 +00:00
|
|
|
<!-- spellchecker-disable -->
|
2020-03-15 12:46:12 +00:00
|
|
|
{{< toc >}}
|
2020-06-07 14:54:30 +00:00
|
|
|
<!-- spellchecker-enable -->
|
2020-03-15 12:46:12 +00:00
|
|
|
|
2020-06-03 20:40:20 +00:00
|
|
|
_docker-tidy_ comes with default settings which should be sufficient for most users to start, but you can adjust most settings to your needs.
|
2020-03-15 12:21:36 +00:00
|
|
|
|
|
|
|
Changes can be made on different locations which will be processed in the following order (last wins):
|
|
|
|
|
2020-06-03 20:40:20 +00:00
|
|
|
- default configuration (build-in)
|
|
|
|
- global configuration file (path depends on your operating system)
|
|
|
|
- directory based configuration file (.dockertidy.yml|.dockertidy.yaml|.dockertidy in current working directory)
|
|
|
|
- environment variables
|
|
|
|
- CLI options
|
2020-03-15 12:21:36 +00:00
|
|
|
|
|
|
|
## Default settings
|
|
|
|
|
2020-06-03 20:40:20 +00:00
|
|
|
<!-- prettier-ignore-start -->
|
2020-03-15 12:21:36 +00:00
|
|
|
<!-- markdownlint-disable -->
|
2020-06-07 14:54:30 +00:00
|
|
|
<!-- spellchecker-disable -->
|
2020-03-15 12:21:36 +00:00
|
|
|
{{< highlight YAML "linenos=table" >}}
|
|
|
|
---
|
|
|
|
# don't do anything
|
|
|
|
dry_run: False
|
2020-03-15 12:30:37 +00:00
|
|
|
http_timeout: 60
|
2020-03-15 12:21:36 +00:00
|
|
|
|
|
|
|
logging:
|
|
|
|
# possible options debug | info | warning | error | critical
|
|
|
|
level: "warning"
|
|
|
|
# you can enable json logging if a parsable output is required
|
|
|
|
json: False
|
|
|
|
|
2020-03-15 12:30:37 +00:00
|
|
|
gc:
|
|
|
|
max_container_age:
|
|
|
|
max_image_age:
|
|
|
|
dangling_volumes: false
|
|
|
|
exclude_images: []
|
|
|
|
exclude_container_labels: []
|
|
|
|
|
|
|
|
stop:
|
|
|
|
max_run_time:
|
|
|
|
prefix: []
|
2020-03-15 12:21:36 +00:00
|
|
|
{{< /highlight >}}
|
2020-06-07 14:54:30 +00:00
|
|
|
<!-- spellchecker-enable -->
|
|
|
|
<!-- markdownlint-restore -->
|
2020-06-03 20:40:20 +00:00
|
|
|
<!-- prettier-ignore-end -->
|
2020-03-15 12:21:36 +00:00
|
|
|
|
|
|
|
## Environment Variables
|
|
|
|
|
2020-06-03 20:40:20 +00:00
|
|
|
<!-- prettier-ignore-start -->
|
2020-03-15 12:21:36 +00:00
|
|
|
<!-- markdownlint-disable -->
|
2020-06-07 14:54:30 +00:00
|
|
|
<!-- spellchecker-disable -->
|
2020-03-15 12:21:36 +00:00
|
|
|
{{< highlight Shell "linenos=table" >}}
|
|
|
|
TIDY_CONFIG_FILE=
|
|
|
|
TIDY_DRY_RUN=False
|
|
|
|
TIDY_HTTP_TIMEOUT=60
|
|
|
|
TIDY_LOG_LEVEL=warning
|
|
|
|
TIDY_LOG_JSON=False
|
|
|
|
TIDY_GC_MAX_CONTAINER_AGE=
|
|
|
|
TIDY_GC_MAX_IMAGE_AGE=
|
|
|
|
TIDY_GC_DANGLING_VOLUMES=False
|
|
|
|
# comma-separated list
|
|
|
|
TIDY_GC_EXCLUDE_IMAGES=
|
|
|
|
# comma-separated list
|
|
|
|
TIDY_GC_EXCLUDE_CONTAINER_LABELS=
|
|
|
|
TIDY_STOP_MAX_RUN_TIME=
|
|
|
|
# comma-separated list
|
|
|
|
TIDY_STOP_PREFIX=
|
|
|
|
{{< /highlight >}}
|
2020-06-07 14:54:30 +00:00
|
|
|
<!-- spellchecker-enable -->
|
|
|
|
<!-- markdownlint-restore -->
|
2020-06-03 20:40:20 +00:00
|
|
|
<!-- prettier-ignore-end -->
|
2020-03-15 12:21:36 +00:00
|
|
|
|
|
|
|
## CLI options
|
|
|
|
|
2020-06-03 20:40:20 +00:00
|
|
|
You can get all available CLI options by running `docker-tidy --help`:
|
2020-03-15 12:21:36 +00:00
|
|
|
|
2020-06-03 20:40:20 +00:00
|
|
|
<!-- prettier-ignore-start -->
|
2020-03-15 12:21:36 +00:00
|
|
|
<!-- markdownlint-disable -->
|
2020-06-07 14:54:30 +00:00
|
|
|
<!-- spellchecker-disable -->
|
2020-03-15 12:21:36 +00:00
|
|
|
{{< highlight Shell "linenos=table" >}}
|
|
|
|
$ docker-tidy --help
|
|
|
|
usage: docker-tidy [-h] [--dry-run] [-t HTTP_TIMEOUT] [-v] [-q] [--version]
|
|
|
|
{gc,stop} ...
|
|
|
|
|
2020-03-15 13:50:58 +00:00
|
|
|
keep docker hosts tidy
|
2020-03-15 12:21:36 +00:00
|
|
|
|
|
|
|
positional arguments:
|
|
|
|
{gc,stop} sub-command help
|
2020-03-15 13:50:58 +00:00
|
|
|
gc run docker garbage collector
|
|
|
|
stop stop containers that have been running for too long
|
2020-03-15 12:21:36 +00:00
|
|
|
|
|
|
|
optional arguments:
|
|
|
|
-h, --help show this help message and exit
|
2020-03-15 13:50:58 +00:00
|
|
|
--dry-run only log actions, don't stop anything
|
2020-03-15 12:21:36 +00:00
|
|
|
-t HTTP_TIMEOUT, --timeout HTTP_TIMEOUT
|
2020-03-15 13:50:58 +00:00
|
|
|
HTTP timeout in seconds for making docker API calls
|
2020-03-15 12:21:36 +00:00
|
|
|
-v increase log level
|
|
|
|
-q decrease log level
|
|
|
|
--version show program's version number and exit
|
|
|
|
{{< /highlight >}}
|
2020-06-07 14:54:30 +00:00
|
|
|
<!-- spellchecker-enable -->
|
|
|
|
<!-- markdownlint-restore -->
|
2020-06-03 20:40:20 +00:00
|
|
|
<!-- prettier-ignore-end -->
|