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 | Docker Hub, Harbor, ECR | |
Protocol | OCI Distribution Spec | |
Identified by | digest ( |
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
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.
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
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
Open Container Initiative (2024). OCI Distribution Specification. https://github.com/opencontainers/distribution-spec
CNCF (2024). Cloud Native Glossary — Container Registry. https://glossary.cncf.io/container-registry/
Docker (2024). Distribution. https://docs.docker.com/registry/
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
● broader ● narrower ● related
Sources
Open Container Initiative (2024). OCI Distribution Specification. https://github.com/opencontainers/distribution-spec
CNCF (2024). Cloud Native Glossary — Container Registry. https://glossary.cncf.io/container-registry/
Docker (2024). Distribution. https://docs.docker.com/registry/