ikke_t.container_image_cleanup
Container Image Cleanup
This tool regularly removes all unused container images from your computer. It sets up a scheduled task (cron job) depending on whether you have Podman or Docker installed.
Requirements
Before setting up the scheduled task, it checks if either Podman or Docker is installed on your system.
Role Variables
There are settings in the defaults/main.yml file to control when the scheduled task runs and to specify where to find Docker and Podman.
- podman_prune_cronjob_special_time
Refer to special time options here: https://docs.ansible.com/ansible/latest/modules/cron_module.html - docker_prune_cronjob_special_time
Refer to special time options here: https://docs.ansible.com/ansible/latest/modules/cron_module.html - podman_prune_opts
Options for Podman system prune, e.g., "--all --force" - docker_prune_opts:
Options for Docker image prune, e.g., "--all --force" - podman_path:
The location of Podman executable, e.g., /usr/bin/podman - docker_path:
The location of Docker executable, e.g., /usr/bin/docker
Dependencies
There are no additional dependencies.
Example Playbook
- name: Regularly clean up unused containers
hosts: all
roles:
- role: container_image_cleanup
vars:
podman_prune_cronjob_special_time: daily
docker_prune_cronjob_special_time: weekly
podman_prune_opts: "--all --force"
docker_prune_opts: "--all --force"
podman_path: /usr/bin/podman
docker_path: /usr/bin/docker
License
GPLv3
Author Information
Ilkka Tengvall, ilkka.tengvall@iki.fi
Informazioni sul progetto
Periodicly cleans up all unused container images from host. Role sets up cron job based on whether podman or docker is installed.
Installa
ansible-galaxy install ikke_t.container_image_cleanup
Licenza
Unknown
Download
2k
Proprietario
I nerd around the clock. At day time for Red Hat, at evenings for my hobby projects. Except when family duties interrupt :) All for open source.