RousselTMLEARNING

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.

1. The registries #

Public, cloud or self-hosted.

Comparison #

RegistryTypeStrengths
Docker HubPublic / SaaSOfficial images; pull limits for anonymous accounts
GitHub Container Registry (ghcr.io)SaaSIntegrated with repositories and GitHub Actions
Amazon ECR, Azure ACR, Google Artifact RegistryCloudCloud IAM, close to the clusters
HarborSelf-hosted (CNCF)Projects, RBAC, Trivy scanning, replication, signing
Lifecycle of a container image

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

Container network security and Kubernetes networking

Secure the container network: how Docker and Kubernetes networking works, CNI, default-deny NetworkPolicies, …

Kubernetes: architecture and components (control plane, nodes, objects)

Understand the Kubernetes architecture: API server, etcd, scheduler, controller manager, kubelet, kube-proxy,…

kubectl cheat sheet: the essential commands

All the kubectl commands you need day to day: contexts, resources, logs, exec, port-forward, rollouts, debug,…

Keep learning

Support us

♥ SUPPORT US

Support RousselTM Learning

Courses, articles, labs and certificates stay free with no intrusive ads. A voluntary contribution, of any amount you choose, pays for hosting, lab environments and new content.

Contribute with PayPal Any amount · card or PayPal accountLearn more
QR code PayPal
Or scan this QR code with your phone

Thank you, every contribution counts!