How would you clean up stale images in a registry safely?
IntermediateProductionRegistries, Tagging & Supply Chain
Answer
Use registry-native retention (ECR lifecycle, Harbor retention, GHCR cleanup actions) with rules like "keep last N per repo", "keep anything deployed" (cross-check with cluster images from kubectl get pods -A -o jsonpath), and expire untagged manifests after a grace period. Dry-run first. Self-hosted registry:2 needs registry garbage-collect with the registry in read-only mode.
More on Registries, Tagging & Supply Chain
What is a good image tagging strategy for production?BeginnerWhy is deploying by digest better than by tag?IntermediateHow do you enable immutable tags and lifecycle rules in ECR?IntermediateHow does ECR handle scanning and replication?IntermediateHow do you give an EKS node or CI job access to ECR with least privilege?IntermediateDocker Hub vs ECR vs GHCR vs Harbor: how do you choose?Intermediate