Interview Prep/Docker/Registries, Tagging & Supply Chain

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.

All Docker questions Roadmap: Docker & containers

More on Registries, Tagging & Supply Chain