docker-cleanup: Add role to prune old images
This commit is contained in:
parent
cb6f8b1865
commit
95730a6a96
17 changed files with 79 additions and 0 deletions
1
camo.yml
1
camo.yml
|
@ -21,6 +21,7 @@
|
|||
roles:
|
||||
- docker
|
||||
- docker-compose
|
||||
- docker-cleanup
|
||||
- traefik
|
||||
- camo
|
||||
environment:
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
roles:
|
||||
- docker
|
||||
- docker-compose
|
||||
- docker-cleanup
|
||||
- traefik
|
||||
- codimd
|
||||
environment:
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
roles:
|
||||
- docker
|
||||
- docker-compose
|
||||
- docker-cleanup
|
||||
- docker-ipv6-nat
|
||||
environment:
|
||||
PYTHONPATH: /opt/python2/ansible-dependencies/lib/python2.7/site-packages
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
roles:
|
||||
- docker
|
||||
- docker-compose
|
||||
- docker-cleanup
|
||||
- gitlab-runner
|
||||
environment:
|
||||
PYTHONPATH: /opt/python2/ansible-dependencies/lib/python2.7/site-packages
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
roles:
|
||||
- docker
|
||||
- docker-compose
|
||||
- docker-cleanup
|
||||
- traefik
|
||||
- gitlab
|
||||
environment:
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
roles:
|
||||
- docker
|
||||
- docker-compose
|
||||
- docker-cleanup
|
||||
- traefik
|
||||
- keycloak
|
||||
environment:
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
roles:
|
||||
- docker
|
||||
- docker-compose
|
||||
- docker-cleanup
|
||||
- traefik
|
||||
- mastodon
|
||||
environment:
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
roles:
|
||||
- docker
|
||||
- docker-compose
|
||||
- docker-cleanup
|
||||
- traefik
|
||||
- minecraft-blockmap
|
||||
environment:
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
roles:
|
||||
- docker
|
||||
- docker-compose
|
||||
- docker-cleanup
|
||||
- minecraft
|
||||
environment:
|
||||
PYTHONPATH: /opt/python2/ansible-dependencies/lib/python2.7/site-packages
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
roles:
|
||||
- docker
|
||||
- docker-compose
|
||||
- docker-cleanup
|
||||
- traefik
|
||||
- minio
|
||||
environment:
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
roles:
|
||||
- docker
|
||||
- docker-compose
|
||||
- docker-cleanup
|
||||
- traefik
|
||||
- monitoring
|
||||
environment:
|
||||
|
@ -30,6 +31,7 @@
|
|||
roles:
|
||||
- docker
|
||||
- docker-compose
|
||||
- docker-cleanup
|
||||
- telegraf
|
||||
environment:
|
||||
PYTHONPATH: /opt/python2/ansible-dependencies/lib/python2.7/site-packages
|
||||
|
|
24
roles/docker-cleanup/README.md
Normal file
24
roles/docker-cleanup/README.md
Normal file
|
@ -0,0 +1,24 @@
|
|||
docker-cleanup
|
||||
=========
|
||||
|
||||
This will prune unused docker images older than 3 days, to keep the system clean.
|
||||
|
||||
Requirements
|
||||
------------
|
||||
|
||||
You will need to have docker installed with its python package to use this role.
|
||||
|
||||
Role Variables
|
||||
--------------
|
||||
|
||||
None
|
||||
|
||||
Dependencies
|
||||
------------
|
||||
|
||||
- docker
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
GPL-3.0-only
|
15
roles/docker-cleanup/meta/main.yml
Normal file
15
roles/docker-cleanup/meta/main.yml
Normal file
|
@ -0,0 +1,15 @@
|
|||
galaxy_info:
|
||||
author: Christoph Kern
|
||||
description: Cleans up the exsting docker install
|
||||
license: GPL-3.0-only
|
||||
|
||||
min_ansible_version: 2.4
|
||||
|
||||
platforms:
|
||||
- name: CentOS
|
||||
versions:
|
||||
- 7
|
||||
|
||||
galaxy_tags: []
|
||||
|
||||
dependencies: []
|
25
roles/docker-cleanup/tasks/main.yml
Normal file
25
roles/docker-cleanup/tasks/main.yml
Normal file
|
@ -0,0 +1,25 @@
|
|||
---
|
||||
|
||||
# Infrastructure
|
||||
# Ansible instructions to deploy the infrastructure
|
||||
# Copyright (C) 2019-2020 Christoph (Sheogorath) Kern
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, version 3 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
- name: Prune docker images older than 3 days
|
||||
docker_prune:
|
||||
images: yes
|
||||
images_filters:
|
||||
dangling: false
|
||||
until: 72h
|
||||
become: true
|
|
@ -22,6 +22,7 @@
|
|||
roles:
|
||||
- docker
|
||||
- docker-compose
|
||||
- docker-cleanup
|
||||
- traefik
|
||||
- static_websites
|
||||
environment:
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
roles:
|
||||
- docker
|
||||
- docker-compose
|
||||
- docker-cleanup
|
||||
- teamspeak
|
||||
environment:
|
||||
PYTHONPATH: /opt/python2/ansible-dependencies/lib/python2.7/site-packages
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
roles:
|
||||
- docker
|
||||
- docker-compose
|
||||
- docker-cleanup
|
||||
- traefik
|
||||
environment:
|
||||
PYTHONPATH: /opt/python2/ansible-dependencies/lib/python2.7/site-packages
|
||||
|
|
Loading…
Add table
Reference in a new issue