Default setting to keep ALL containers protects Rancher templates where run-once containers are used; in general Rancher will remove its own containers where necessary. User of Shell Wildcards allows more flexibility when specifying images to be kept during the sweep.
17 lines
444 B
YAML
17 lines
444 B
YAML
cleanup:
|
|
image: sshipway/docker-cleanup:1.5.2
|
|
environment:
|
|
CLEAN_PERIOD: ${FREQUENCY}
|
|
DELAY_TIME: "900"
|
|
KEEP_IMAGES: "${KEEP}"
|
|
KEEP_CONTAINERS: "${KEEPC}"
|
|
labels:
|
|
io.rancher.scheduler.global: "true"
|
|
io.rancher.scheduler.affinity:host_label_ne: "${EXCLUDE_LABEL}"
|
|
privileged: true
|
|
tty: false
|
|
stdin_open: false
|
|
volumes:
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
- /var/lib/docker:/var/lib/docker
|