Interview's MateDocker
Interview's Mate

Docker

Compose · Networking · Security · Ops

Visualizer

DSA Visualizer
All 32 lessons
Custom Playground
Try your own examples

Learning

System Design
31 architecture topics
SQL Learning
160 foundations → production topics
AI Engineering
160 LLM → backend topics
Data Science
160 Python → MLOps topics
Data Engineer
160 SQL → streaming topics
Docker
160 Docker learning topics
Kubernetes
160 K8s fundamentals → cloud
Java LearnSoon
Coming soon
Python Learn
Interview Q&A & internals
JavaScript Learn
Closures, async & DOM Q&A
Tech Learn
Search, practise & track Q&A
AI DSA Practice
Solve coding problems
Theme
Home
Docker topics
Lesson 121/ 160
07. CI/CD, Registries & Production Operations

Container Registries Deep Dive (Docker Hub, GHCR, AWS ECR, GAR, ACR)

Compare major registries for auth, pricing, regionality, and CI integration.

BeginnerGHCR · ECR3 quiz questions
Practice DevOps Q&A
In plain wordsDiagramTheoryStep by stepWhen to use itInterview cluesMistakes to avoidQuiz (3)Practice

In plain words

Choose a registry by identity model, network residency, availability, lifecycle policy and artifact support-not brand familiarity alone.

Think of it like…

A registry is a multi-tenant warehouse: address, guard desk, inventory rules and truck routes matter as much as the boxes on the shelf.

Where you’ve seen it

In practice, aws ecr get-login-password --region ap-south-1 | docker login --username AWS --password-stdin 123456789012.dkr.ecr.ap-south-1.amazonaws.com is the concrete move for this job: compare major registries for auth, pricing, regionality, and CI integration. The release is not accepted until docker pull from a least-privileged CI role and compare image manifest digest, regional latency and package visibility confirms the result.

Words you’ll hear

GHCR
The implementation control in aws ecr get-login-password --region ap-south-1 | docker login --username AWS --password-stdin 123456789012.dkr.ecr.ap-south-1.amazonaws.com for compare major registries for auth, pricing, regionality, and CI integration.
ECR
The result to observe with docker pull from a least-privileged CI role and compare image manifest digest, regional latency and package visibility, rather than infer from a successful command alone.
Docker Hub
The production boundary exposed when giving a long-lived registry password to a public PR workflow, or assuming every image format can be stored and signed identically.

Visual diagram

Loading interactive diagram

Theory & deep dive

GHCR control path

The concrete mechanism is aws ecr get-login-password --region ap-south-1 | docker login --username AWS --password-stdin 123456789012.dkr.ecr.ap-south-1.amazonaws.com. The observable result is docker pull from a least-privileged CI role and compare image manifest digest, regional latency and package visibility; if those disagree, inspect the runtime evidence before changing unrelated settings.

Compare major registries for auth, pricing, regionality, and CI integration. Keep GHCR, ECR and Docker Hub in the same deployment record so the intent and the observed state cannot drift apart.

Concrete GHCR setup

aws ecr get-login-password --region ap-south-1 | docker login --username AWS --password-stdin 123456789012.dkr.ecr.ap-south-1.amazonaws.com

Key takeaway: Prove ECR with docker pull from a least-privileged CI role and compare image manifest digest, regional latency and package visibility, not with command success alone.

Docker Hub failure boundary

A public namespace has quota/rate-limit implications, and cross-region pulls affect cost and latency. GHCR package permissions can differ from repository permissions, while cloud registries may require short-lived workload credentials and private endpoints. The narrow failure to design for is giving a long-lived registry password to a public PR workflow, or assuming every image format can be stored and signed identically.

Accept this compromise explicitly: Managed registries reduce operations and integrate identity; self-hosting can satisfy residency/policy at the cost of upgrades, HA, TLS and storage. The controlled check-docker pull from a least-privileged CI role and compare image manifest digest, regional latency and package visibility-also identifies the point where a different design is safer.

Deliberate failure test

Exercise this failure safely: giving a long-lived registry password to a public PR workflow, or assuming every image format can be stored and signed identically.

Key takeaway: Managed registries reduce operations and integrate identity; self-hosting can satisfy residency/policy at the cost of upgrades, HA, TLS and storage.

How it works, step by step

Step 1 of 4
Design

1. State the boundary

Write down why the workload needs this: A public namespace has quota/rate-limit implications, and cross-region pulls affect cost and latency. GHCR package permissions can differ from repository permissions, while cloud registries may require short-lived workload credentials and private endpoints.

Choose a registry by identity model, network residency, availability, lifecycle policy and artifact support-not brand familiarity alone.
Key numbers at this step
Intent
GHCR

When to use it & trade-offs

What it is

A registry maps repositories and manifests to immutable blobs and defines authorization, quotas, geography, retention, scanning and replication around that content. Docker Hub favors broad public distribution; ECR/GAR/ACR and GHCR integrate with their cloud or source-control identities.

Why it matters: A public namespace has quota/rate-limit implications, and cross-region pulls affect cost and latency. GHCR package permissions can differ from repository permissions, while cloud registries may require short-lived workload credentials and private endpoints.

When to reach for it

  • The fit is strongest for this job: compare major registries for auth, pricing, regionality, and CI integration. Pair it with docker pull from a least-privileged CI role and compare image manifest digest, regional latency and package visibility in the runbook.
  • Production GHCR changes should make ECR observable through aws ecr get-login-password --region ap-south-1 | docker login --username AWS --password-stdin 123456789012.dkr.ecr.ap-south-1.amazonaws.com, rather than trusting the runtime default.
  • Keep a rollback example for the case where giving a long-lived registry password to a public PR workflow, or assuming every image format can be stored and signed identically.

When to avoid or be careful

  • Do not accept command success while the system can still fail by giving a long-lived registry password to a public PR workflow, or assuming every image format can be stored and signed identically.
  • Avoid erasing Docker Hub protection merely to dodge this cost: “Managed registries reduce operations and integrate identity; self-hosting can satisfy residency/policy at the cost of upgrades, HA, TLS and storage”.
  • Do not replace the evidence path-docker pull from a least-privileged CI role and compare image manifest digest, regional latency and package visibility-with a screenshot or a mutable tag.

aws ecr get-login-password --region ap-south-1 | docker login --username AWS --password-stdin 123456789012.dkr.ecr.ap-south-1.amazonaws.com: practical choices

Explicit GHCR
Best for: Compare major registries for auth, pricing, regionality, and CI integration, with a reviewed runbook.

Strengths: A registry maps repositories and manifests to immutable blobs and defines authorization, quotas, geography, retention, scanning and replication around that content. Docker Hub favors broad public distribution; ECR/GAR/ACR and GHCR integrate with their cloud or source-control identities.

Watch out: Managed registries reduce operations and integrate identity; self-hosting can satisfy residency/policy at the cost of upgrades, HA, TLS and storage.

Ambient default
Best for: Short-lived ECR experiments with low blast radius.

Strengths: It can begin with aws ecr get-login-password --region ap-south-1 | docker login --username AWS --password-stdin 123456789012.dkr.ecr.ap-south-1.amazonaws.com and fewer surrounding controls.

Watch out: It silently accepts giving a long-lived registry password to a public PR workflow, or assuming every image format can be stored and signed identically, which makes the result hard to reproduce after promotion.

Managed Docker Hub
Best for: Teams that centralize Docker Hub policy across many workloads.

Strengths: A public namespace has quota/rate-limit implications, and cross-region pulls affect cost and latency. GHCR package permissions can differ from repository permissions, while cloud registries may require short-lived workload credentials and private endpoints.

Watch out: The platform adds an ownership and debugging layer; retain docker pull from a least-privileged CI role and compare image manifest digest, regional latency and package visibility as the direct check.

Interview signals & numbers to know

When this topic comes up

  • aws ecr get-login-password --region ap-south-1 | docker login --username AWS --password-stdin 123456789012.dkr.ecr.ap-south-1.amazonaws.com
  • docker pull from a least-privileged CI role and compare image manifest digest, regional latency and package visibility
  • Failure signature: giving a long-lived registry password to a public PR workflow, or assuming every image format can be stored and signed identically
  • Trade-off: Managed registries reduce operations and integrate identity; self-hosting can satisfy residency/policy at the cost of upgrades, HA, TLS and storage.

Benchmarks & rules of thumb

4 identity choices -
anonymous, username/token, cloud role and workload OIDC
1 regional path -
often controls private endpoint and egress cost
OCI artifacts -
support should be checked for SBOMs, signatures and Helm

Common mistakes & follow-ups

Common interview mistakes

  • Treating a successful aws ecr get-login-password --region ap-south-1 | docker login --username AWS --password-stdin 123456789012.dkr.ecr.ap-south-1.amazonaws.com as proof and skipping docker pull from a least-privileged CI role and compare image manifest digest, regional latency and package visibility.
  • Giving a long-lived registry password to a public PR workflow, or assuming every image format can be stored and signed identically
  • Optimizing GHCR without accepting that managed registries reduce operations and integrate identity; self-hosting can satisfy residency/policy at the cost of upgrades, HA, TLS and storage.

Likely interviewer follow-ups

  • Why does aws ecr get-login-password --region ap-south-1 | docker login --username AWS --password-stdin 123456789012.dkr.ecr.ap-south-1.amazonaws.com address GHCR here rather than through application code?
  • How would you distinguish healthy ECR from the failure “giving a long-lived registry password to a public PR workflow, or assuming every image format can be stored and signed identically” using docker pull from a least-privileged CI role and compare image manifest digest, regional latency and package visibility?
  • When would this trade-off-“Managed registries reduce operations and integrate identity; self-hosting can satisfy residency/policy at the cost of upgrades, HA, TLS and storage”-justify a different Docker Hub design?
Interview tip: Give one concrete operation-aws ecr get-login-password --region ap-south-1 | docker login --username AWS --password-stdin 123456789012.dkr.ecr.ap-south-1.amazonaws.com-and one proof-docker pull from a least-privileged CI role and compare image manifest digest, regional latency and package visibility. Then name the boundary: giving a long-lived registry password to a public PR workflow, or assuming every image format can be stored and signed identically.

Knowledge check

Loading quiz

Put it into practice

Practice related interview Q&A

Apply Container Registries Deep Dive (Docker Hub, GHCR, AWS ECR, GAR, ACR) with generative AI interview Q&A and hands-on practice.

Open DevOps Q&A →Tech Learn Q&A
Previous topic
Runtime Threat Detection & Anomaly Monitoring with Falco
Next topic
Self-Hosting Private Container Registries (Docker Registry, Harbor)