Skip to content

Container registry

A container registry is a versioned, immutable store of container images that build systems push to and deploy systems pull from, so the exact same bytes reach every environment.

Definition

What it is

A container registry is a specialized artifact store for container images. It speaks the OCI Distribution Spec (or the older Docker Registry HTTP API), and stores each image by two identifiers: a tag (app:1.2.3) and a digest (sha256:abc...). The tag is mutable; the digest is not. Production deployments pin the digest, not the tag.

Public registries (Docker Hub, Quay, GitHub Container Registry, AWS ECR, GCR, Azure ACR) and private registries (Harbor, JFrog Artifactory, self-hosted Distribution) all speak the same protocol. Kubernetes, Nomad, and Docker Compose all know how to pull from them.

Why it matters

A container registry gives three properties no build pipeline can guarantee alone. First, immutability: a sha256: digest cannot be overwritten, so the artifact that ran in staging runs in production. Second, access control: only CI can push, only the deploy system can pull. Third, audit: you know which commit produced which image, and where it ran.

Container registry vs general registry

Aspect

DNS registry (D270)

Container registry

Stores

Domain names

Container images

Operator

ICANN, IANA, Verisign

Docker Hub, Harbor, ECR

Protocol

EPP, RDAP, WHOIS

OCI Distribution Spec

Identified by

TLD

digest (sha256:...)

The pipeline

graph LR
  B[Build] -->|push tag+digest| R[Container registry]
  R -->|pull by digest| S[Staging]
  R -->|pull by digest| C[Canary]
  R -->|pull by digest| P[Production]
  style R fill:#E8F5E9

Using one safely

Container registry best practices

  1. Pin by digest, not tag

    image:app@sha256:abc... is immutable. image:app:latest is a promise that breaks.

  2. Enforce immutability

    Harbor, ECR, GCR, ACR all support rejecting re-push. Enable it.

  3. Scan on push

    Trivy, Grype, Snyk. Fail the push on critical CVEs. Post-hoc scans find the damage too late.

  4. Sign with cosign

    cosign sign --key k8s://... <image>. Deploy verifies cosign verify. Unsigned images are trust-by-hope.

  5. Prune old images

    Keep last 20 per tag. A registry with 50,000 stale images costs real money.

Origin

Docker Inc. launched the public Docker Registry alongside Docker 0.9 in 2013. It was the service that made docker push and docker pull work. The Docker Distribution project (open source) followed in 2014, letting teams self-host. In 2015, the Open Container Initiative (OCI) was formed to standardize image format and distribution. The OCI Distribution Spec v1.0 shipped in 2020, and v1.1 in 2024 added the referrers API. Every registry today (public or private) speaks OCI Distribution.

A container registry is an application that stores and distributes container images using the OCI Distribution Specification.

— CNCF, *Cloud Native Glossary*, 2024
2013 · Docker Registry launch
2014 · Docker Distribution open source
2017 · Harbor 1.0 (VMware)
2020 · OCI Distribution Spec v1.0
2024 · OCI Distribution Spec v1.1

Evidence

FAQ

Public vs private?

Public (Docker Hub, Quay) is open; private (Harbor, ECR, GCR) is access-controlled. Enterprises use private.

Digest vs tag?

Tag is human-friendly and mutable (app:1.2.3); digest is content-addressed and immutable (sha256:abc...). Deployments pin the digest.

Container registry vs general registry?

A general registry (see D270) is the DNS organization that administers a TLD. A container registry stores images. Same word, different objects.

Why scan images?

Because base images have CVEs. A green build with an old base is a green build with a known vulnerability.

Connections

Etymology

Origin: compound

  • container (noun): from Latin continēre, "to hold together"
  • registry (noun): from Latin regere, "to rule"; medieval registrum, "book of records"

Semantic network

Container redevopscloud-natiArtifactBuildDeployDigestContainer

● broader ● narrower ● related

Broader

  • devops
  • cloud-native

Related

Sources