Pruning Policy
Generated Bash Script
#!/usr/bin/env bash
# Docker Tag Retention & Cleanup Script
# Generated by MiniToolDesk (100% Client-Side)
set -euo pipefail
KEEP_COUNT=3
DRY_RUN=true
echo "Scanning local Docker images..."
docker images --format '{{.Repository}}:{{.Tag}} {{.CreatedAt}}' | sort -k2 -r | awk -v keep="$KEEP_COUNT" '
{
repo_tag = $1
if (repo_tag ~ /<none>/) next;
split(repo_tag, arr, ":")
repo = arr[1]
count[repo]++
if (count[repo] > keep) {
print repo_tag
}
}
' | while read -r image; do
if [ "$DRY_RUN" = "true" ]; then
echo "[DRY-RUN] Would remove old image tag: $image"
else
echo "Removing image tag: $image"
docker rmi "$image" || true
fi
done
echo "Cleanup completed successfully!"Pin this tool to your browser side panel
Access this utility anytime with Alt+M without switching tabs. 100% offline & free.
How to use Docker Image Tag Cleaner Script Gen
- 1Configure parameters in the workspace.
- 2Inspect the real-time generated output.
- 3Copy or download the resulting configuration.
Client-Side Privacy Guarantee
All calculations run in your browser memory without server transmission.
Frequently Asked Questions
Enjoying Docker Image Tag Cleaner Script Gen?Help your engineering peers discover private, ad-free tools!
MiniToolDesk is 100% free and client-side. Your support keeps the web ad-free.
Related Developer Utilities
Popular
Docker Run to Compose Converter
Convert complex docker run CLI commands into clean, production-ready docker-compose.yml files
Launch toolβ
Popular
Nginx Config Generator
Visual builder for production-ready Nginx reverse proxy, SSL, and SPA configs
Launch toolβ
Popular
Dockerfile Multi-Stage Generator
Visual builder for security-hardened, multi-stage Dockerfiles across modern stacks
Launch toolβ
Popular
Kubernetes YAML Manifest Builder
Visual generator for Deployment, Service, Ingress, and ConfigMap manifests
Launch toolβ