Files
nas-ops/nas-docker-prune

23 lines
513 B
Bash

#!/bin/bash
# nas-docker-prune — Remove orphaned (dangling) Docker images
# Usage: nas-docker-prune
# Call after nas-docker-up to clean up replaced images
set -euo pipefail
if [ -t 1 ]; then INTERACTIVE=true; else INTERACTIVE=false; fi
if $INTERACTIVE; then
CYAN='\033[0;36m'
GREEN='\033[0;32m'
BOLD='\033[1m'
RESET='\033[0m'
echo -e "${CYAN}🧹 Removing orphaned images...${RESET}"
fi
docker image prune -f
if $INTERACTIVE; then
echo -e "${GREEN}✅ Cleanup complete.${RESET}"
fi