bazzite/just_scripts/cleanup-images.sh

16 lines
354 B
Bash
Raw Normal View History

#!/usr/bin/bash
set -euox pipefail
container_mgr=(
docker
podman
podman-remote
)
for i in "${container_mgr[@]}"; do
if [[ $(command -v "$i") ]]; then
echo "Container Manager: ${i}"
ID=$(${i} images --filter "reference=localhost/bazzite*-build")
xargs -I {} "${i}" image rm {} <<< "$ID"
echo ""
fi
done