Skip to content

Simple Ansible role to cleanup (prune) all unused container images from your podman/docker hosts.

Notifications You must be signed in to change notification settings

ikke-t/container-image-cleanup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Container Image Cleanup

Periodicly cleans up all unused container images from host. Role sets up cron job based on whether podman or docker is installed.

Requirements

Role checks if either Podman or Docker is installed on host before installing cronjob.

Role Variables

There are variables in defaults/main.yml for timing of cronjob, as well as path to binaries for docker and podman to check for.

Dependencies

No dependencies.

Example Playbook

- name: periodicly 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, [email protected]

About

Simple Ansible role to cleanup (prune) all unused container images from your podman/docker hosts.

Resources

Stars

Watchers

Forks

Packages

No packages published