From 791add1e9395d59ae35894004c852e5d7bb75510 Mon Sep 17 00:00:00 2001 From: yeti Date: Thu, 17 Apr 2025 22:56:02 +0100 Subject: [PATCH] feat(script): add script to cleanup images --- clean_dangling_images.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 clean_dangling_images.sh diff --git a/clean_dangling_images.sh b/clean_dangling_images.sh new file mode 100755 index 0000000..96a9f8c --- /dev/null +++ b/clean_dangling_images.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# Get list of image IDs with tag (dangling images) +dangling_images=$(podman images -f "dangling=true" -q) + +if [ -z "$dangling_images" ]; then + echo "✅ No dangling images to remove." +else + echo "⚠️ Removing dangling images..." + echo "$dangling_images" | xargs podman rmi -f + echo "🧹 Done!" +fi