# Container Registries

> Store, version, secure and distribute images through public and private registries. Free notes, key concepts, resources and a mini project.

Canonical: https://www.internhack.in/roadmaps/tracks/devops/container-registries
Last updated: 2026-11-28

Store, version, secure and distribute images through public and private registries.

Intermediate · about 3 hours · difficulty 2/5

Learn first: [Building Good Images](https://www.internhack.in/roadmaps/tracks/devops/dockerfiles-images)

A **registry** stores images so CI can push them and servers or clusters can pull them. Choosing and configuring it well affects security, cost and deploy reliability.

### Options

- Public: **Docker Hub** (note pull rate limits for anonymous users), GitHub Container Registry (`ghcr.io`), Quay.
- Cloud: **Amazon ECR**, Google Artifact Registry, Azure Container Registry. These integrate with cloud IAM so nodes pull without static passwords.
- Self-hosted: **Harbor** (adds scanning, replication, RBAC) or the plain `registry` image.

### Concepts

- Image reference: `registry/namespace/repo:tag@sha256:digest`. Tags are mutable pointers; **digests** are immutable.
- **Immutable tags** setting prevents overwriting a released version.
- **Lifecycle policies** delete untagged or old images to control storage cost.
- Pull-through caches and mirrors avoid external rate limits and outages.
- Scanning on push and signed images (covered later in supply chain security).

### Pitfalls

Pulling from Docker Hub in every CI job and hitting rate limits, long-lived registry passwords stored in CI, and deploying by mutable tag so two nodes end up running different code.

**Good enough to move on:** you can push an image from CI to a private registry using short-lived credentials, reference it by digest, and set a lifecycle policy.

## Key concepts

- **Docker Hub and rate limits**
- **Cloud registries (ECR, GAR, ACR)**
- **GitHub Container Registry**
- **Tags vs digests**
- **Immutable tags and lifecycle policies**
- **Harbor self-hosted**
- **Pull-through caches**

## Mini project

Create a private repository in ECR or GHCR, push an image tagged with the git SHA, pull it on another machine by digest, and configure a policy that removes untagged images after 7 days.

## Check yourself

Why does deploying by digest give stronger guarantees than deploying by tag?

## Free resources

- [Amazon ECR docs](https://docs.aws.amazon.com/ecr/) (AWS)
- [Working with the Container registry](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry) (GitHub)

Previous: [Building Good Images](https://www.internhack.in/roadmaps/tracks/devops/dockerfiles-images) · Next: [Docker Compose for Multi-Container Apps](https://www.internhack.in/roadmaps/tracks/devops/docker-compose)

## More in Containers in Depth

- [Containers and Docker Basics](https://www.internhack.in/roadmaps/tracks/devops/container-fundamentals)
- [Building Good Images](https://www.internhack.in/roadmaps/tracks/devops/dockerfiles-images)
- [Container Registries](https://www.internhack.in/roadmaps/tracks/devops/container-registries)
- [Docker Compose for Multi-Container Apps](https://www.internhack.in/roadmaps/tracks/devops/docker-compose)
- [Container Security Essentials](https://www.internhack.in/roadmaps/tracks/devops/container-security)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [DevOps Engineer Roadmap](https://www.internhack.in/roadmaps/tracks/devops)
