Pin by digest, enforce immutability, scan on push, sign with cosign, and prune old images.
Container registry best practices
Pin by digest, not tag
image:app@sha256:abc...is immutable.image:app:latestis a promise that breaks.Enforce immutability
Harbor, ECR, GCR, ACR all support rejecting re-push. Enable it.
Scan on push
Trivy, Grype, Snyk. Fail the push on critical CVEs. Post-hoc scans find the damage too late.
Sign with cosign
cosign sign --key k8s://... <image>. Deploy verifiescosign verify. Unsigned images are trust-by-hope.Prune old images
Keep last 20 per tag. A registry with 50,000 stale images costs real money.