registry: Add monthly garbage collection
This commit is contained in:
parent
f99666a20a
commit
151e163383
@ -28,6 +28,25 @@ services:
|
|||||||
- traefik.http.services.{{ service }}.loadbalancer.server.port=5000
|
- traefik.http.services.{{ service }}.loadbalancer.server.port=5000
|
||||||
networks: ['{{ ingress_network }}']
|
networks: ['{{ ingress_network }}']
|
||||||
|
|
||||||
|
image-cleanup-job:
|
||||||
|
image: registry:2
|
||||||
|
command: ["registry", "garbage-collect", "/etc/docker/registry/config.yml", "-m"]
|
||||||
|
secrets:
|
||||||
|
- source: htpasswd_{{ registry_htpasswd.stat.checksum }}
|
||||||
|
target: /etc/docker/registry/htpasswd
|
||||||
|
configs:
|
||||||
|
- source: registry_{{ registry_config.checksum }}
|
||||||
|
target: /etc/docker/registry/config.yml
|
||||||
|
deploy:
|
||||||
|
placement:
|
||||||
|
constraints:
|
||||||
|
- node.role == manager
|
||||||
|
labels:
|
||||||
|
- "swarm.cronjob.enable=true"
|
||||||
|
- "swarm.cronjob.schedule=0 0 0 1 * *"
|
||||||
|
restart_policy:
|
||||||
|
condition: none
|
||||||
|
|
||||||
configs:
|
configs:
|
||||||
registry_{{ registry_config.checksum }}:
|
registry_{{ registry_config.checksum }}:
|
||||||
file: ./config/config.yml
|
file: ./config/config.yml
|
||||||
|
Loading…
Reference in New Issue
Block a user