Containers
Container registry: choosing and securing your image registry (Docker Hub, Harbor, GHCR, ECR)
Understand container registries: Docker Hub, GitHub Container Registry, cloud registries (ECR, ACR, Artifact Registry) and self-hosted Harbor; authentication, vulnerability scanning, signing, retention and mirrors.
Martin LEKPA2 min readPublished Updated
1. The registries #
Public, cloud or self-hosted.
Comparison #
| Registry | Type | Strengths |
|---|
| Docker Hub | Public / SaaS | Official images; pull limits for anonymous accounts |
| GitHub Container Registry (ghcr.io) | SaaS | Integrated with repositories and GitHub Actions |
| Amazon ECR, Azure ACR, Google Artifact Registry | Cloud | Cloud IAM, close to the clusters |
| Harbor | Self-hosted (CNCF) | Projects, RBAC, Trivy scanning, replication, signing |

2. Securing #
An image is code running in production.
Practices #
docker build -t registry.example.com/shop/api:1.4.2 .
trivy image --severity HIGH,CRITICAL --exit-code 1 registry.example.com/shop/api:1.4.2
docker push registry.example.com/shop/api:1.4.2
cosign sign registry.example.com/shop/api@sha256:<digest>
- Immutable tags (version or digest), never
latest in production. - Limited-privilege service accounts for CI; read-only for clusters.
- Mirror or cache of public images (Harbor proxy cache) against Docker Hub limits and outages.
- Retention policy to delete unused images.
Good practice: Deploy by digest (@sha256:...): it is the only guarantee that the image in production is exactly the one that was scanned and signed.
Related articles
Secure the container network: how Docker and Kubernetes networking works, CNI, default-deny NetworkPolicies, …
Understand the Kubernetes architecture: API server, etcd, scheduler, controller manager, kubelet, kube-proxy,…
All the kubectl commands you need day to day: contexts, resources, logs, exec, port-forward, rollouts, debug,…
Get new articles and courses
A weekly or monthly digest, as you prefer, only when there is something new. Unsubscribe in one click.