osbs: cron job to clean up docker storage nightly

Signed-off-by: Adam Miller <maxamillion@fedoraproject.org>
This commit is contained in:
Adam Miller 2016-10-21 09:38:13 -05:00 committed by Adam Miller
parent 6d59db947b
commit 81a732c05f
2 changed files with 9 additions and 0 deletions

View file

@ -0,0 +1,4 @@
SHELL=/bin/bash
MAILTO=maxamillion@fedoraproject.org
0 0 * * * root for i in for i in $(docker ps -a | awk '/Exited/ { print $1 }'); do docker rm $i; done && for i in $(docker images -q -f 'dangling=true'); do docker rmi $i; done

View file

@ -40,6 +40,11 @@
- /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml
tasks:
- name: cron entry to clean up docker storage
copy:
src: "{{files}}/osbs/cleanup-docker-storage"
dest: "/etc/cron.d/cleanup-docker-storage"
- name: copy docker-storage-setup config
copy:
src: "{{files}}/osbs/docker-storage-setup"