aurora/scripts/cleanup-images.sh
m2 6b38313476
feat(dev): improve just commands (#1297)
Co-authored-by: Jorge O. Castro <jorge.castro@gmail.com>
2024-05-15 10:26:16 -04:00

15 lines
420 B
Bash
Executable file

#!/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/bluefin*-build*" --filter "reference=localhost/aurora*-build*" --format "{{.ID}}")
xargs -I {} "${i}" image rm {} <<< "$ID"
echo ""
fi
done