From d72bcfd23f2e8ee3cdb0b65a880b6a97cb44df14 Mon Sep 17 00:00:00 2001 From: shockrah Date: Sun, 6 Mar 2022 16:43:41 -0800 Subject: [PATCH] - Playbook to help cleanup untagged docker images --- docker-host/setup/handlers/docker-cleanup.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 docker-host/setup/handlers/docker-cleanup.yml diff --git a/docker-host/setup/handlers/docker-cleanup.yml b/docker-host/setup/handlers/docker-cleanup.yml new file mode 100644 index 0000000..cf44cc6 --- /dev/null +++ b/docker-host/setup/handlers/docker-cleanup.yml @@ -0,0 +1,6 @@ +- name: Cleanup old containers + become: yes + become_method: sudo + listen: cleanup-docker + command: docker images | grep none | awk '{print $3}' | xargs docker rmi +