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 122/ 160
07. CI/CD, Registries & Production Operations

Self-Hosting Private Container Registries (Docker Registry, Harbor)

Run a private registry or Harbor for on-prem control, scanning, and policies.

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

In plain words

Self-host only when residency, disconnected operation or policy integration justifies owning a critical write/read path.

Think of it like…

Hosting a private warehouse means owning the guards, inventory database, loading bays and fire exits-not just renting an empty building.

Where you’ve seen it

In practice, helm install harbor harbor/harbor -n registry --set expose.type=ingress --set externalURL=https://registry.example.com is the concrete move for this job: run a private registry or Harbor for on-prem control, scanning, and policies. The release is not accepted until push a test digest through OIDC/RBAC, replicate it, run a GC dry plan and restore the registry database plus object store in staging confirms the result.

Words you’ll hear

Harbor
The implementation control in helm install harbor harbor/harbor -n registry --set expose.type=ingress --set externalURL=https://registry.example.com for run a private registry or Harbor for on-prem control, scanning, and policies.
Private Registry
The result to observe with push a test digest through OIDC/RBAC, replicate it, run a GC dry plan and restore the registry database plus object store in staging, rather than infer from a successful command alone.
On-Prem
The production boundary exposed when treating local disk as a durable HA backend, or running garbage collection while manifests are being uploaded and referenced.

Visual diagram

Loading interactive diagram

Theory & deep dive

Harbor control path

The concrete mechanism is helm install harbor harbor/harbor -n registry --set expose.type=ingress --set externalURL=https://registry.example.com. The observable result is push a test digest through OIDC/RBAC, replicate it, run a GC dry plan and restore the registry database plus object store in staging; if those disagree, inspect the runtime evidence before changing unrelated settings.

Run a private registry or Harbor for on-prem control, scanning, and policies. Keep Harbor, Private Registry and On-Prem in the same deployment record so the intent and the observed state cannot drift apart.

Concrete Harbor setup

helm install harbor harbor/harbor -n registry --set expose.type=ingress --set externalURL=https://registry.example.com

Key takeaway: Prove Private Registry with push a test digest through OIDC/RBAC, replicate it, run a GC dry plan and restore the registry database plus object store in staging, not with command success alone.

On-Prem failure boundary

Turning on a registry without TLS/auth makes pushes and pulls an internal supply-chain entry point. Garbage collection requires coordination with active uploads and references, and a HA deployment needs shared or replicated backing storage plus database health. The narrow failure to design for is treating local disk as a durable HA backend, or running garbage collection while manifests are being uploaded and referenced.

Accept this compromise explicitly: Distribution is lean and standards-focused; Harbor adds policy and operators while increasing stateful components. The controlled check-push a test digest through OIDC/RBAC, replicate it, run a GC dry plan and restore the registry database plus object store in staging-also identifies the point where a different design is safer.

Deliberate failure test

Exercise this failure safely: treating local disk as a durable HA backend, or running garbage collection while manifests are being uploaded and referenced.

Key takeaway: Distribution is lean and standards-focused; Harbor adds policy and operators while increasing stateful components.

How it works, step by step

Step 1 of 4
Design

1. State the boundary

Write down why the workload needs this: Turning on a registry without TLS/auth makes pushes and pulls an internal supply-chain entry point. Garbage collection requires coordination with active uploads and references, and a HA deployment needs shared or replicated backing storage plus database health.

Self-host only when residency, disconnected operation or policy integration justifies owning a critical write/read path.
Key numbers at this step
Intent
Harbor

When to use it & trade-offs

What it is

A minimal Docker Distribution registry stores and serves artifacts but still needs TLS, authentication, storage, garbage collection and backups. Harbor adds projects, RBAC, replication, vulnerability policy and a portal on top of a registry core.

Why it matters: Turning on a registry without TLS/auth makes pushes and pulls an internal supply-chain entry point. Garbage collection requires coordination with active uploads and references, and a HA deployment needs shared or replicated backing storage plus database health.

When to reach for it

  • The fit is strongest for this job: run a private registry or Harbor for on-prem control, scanning, and policies. Pair it with push a test digest through OIDC/RBAC, replicate it, run a GC dry plan and restore the registry database plus object store in staging in the runbook.
  • Production Harbor changes should make Private Registry observable through helm install harbor harbor/harbor -n registry --set expose.type=ingress --set externalURL=https://registry.example.com, rather than trusting the runtime default.
  • Keep a rollback example for the case where treating local disk as a durable HA backend, or running garbage collection while manifests are being uploaded and referenced.

When to avoid or be careful

  • Do not accept command success while the system can still fail by treating local disk as a durable HA backend, or running garbage collection while manifests are being uploaded and referenced.
  • Avoid erasing On-Prem protection merely to dodge this cost: “Distribution is lean and standards-focused; Harbor adds policy and operators while increasing stateful components”.
  • Do not replace the evidence path-push a test digest through OIDC/RBAC, replicate it, run a GC dry plan and restore the registry database plus object store in staging-with a screenshot or a mutable tag.

helm install harbor harbor/harbor -n registry --set expose.type=ingress --set externalURL=https://registry.example.com: practical choices

Explicit Harbor
Best for: Run a private registry or Harbor for on-prem control, scanning, and policies, with a reviewed runbook.

Strengths: A minimal Docker Distribution registry stores and serves artifacts but still needs TLS, authentication, storage, garbage collection and backups. Harbor adds projects, RBAC, replication, vulnerability policy and a portal on top of a registry core.

Watch out: Distribution is lean and standards-focused; Harbor adds policy and operators while increasing stateful components.

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

Strengths: It can begin with helm install harbor harbor/harbor -n registry --set expose.type=ingress --set externalURL=https://registry.example.com and fewer surrounding controls.

Watch out: It silently accepts treating local disk as a durable HA backend, or running garbage collection while manifests are being uploaded and referenced, which makes the result hard to reproduce after promotion.

Managed On-Prem
Best for: Teams that centralize On-Prem policy across many workloads.

Strengths: Turning on a registry without TLS/auth makes pushes and pulls an internal supply-chain entry point. Garbage collection requires coordination with active uploads and references, and a HA deployment needs shared or replicated backing storage plus database health.

Watch out: The platform adds an ownership and debugging layer; retain push a test digest through OIDC/RBAC, replicate it, run a GC dry plan and restore the registry database plus object store in staging as the direct check.

Interview signals & numbers to know

When this topic comes up

  • helm install harbor harbor/harbor -n registry --set expose.type=ingress --set externalURL=https://registry.example.com
  • push a test digest through OIDC/RBAC, replicate it, run a GC dry plan and restore the registry database plus object store in staging
  • Failure signature: treating local disk as a durable HA backend, or running garbage collection while manifests are being uploaded and referenced
  • Trade-off: Distribution is lean and standards-focused; Harbor adds policy and operators while increasing stateful components.

Benchmarks & rules of thumb

3 persistent state areas -
registry objects, database and config/certificates
2 HA dependencies -
storage plus service/control-plane placement
0 public anonymous writes -
desired for a private registry

Common mistakes & follow-ups

Common interview mistakes

  • Treating a successful helm install harbor harbor/harbor -n registry --set expose.type=ingress --set externalURL=https://registry.example.com as proof and skipping push a test digest through OIDC/RBAC, replicate it, run a GC dry plan and restore the registry database plus object store in staging.
  • Treating local disk as a durable HA backend, or running garbage collection while manifests are being uploaded and referenced
  • Optimizing Harbor without accepting that distribution is lean and standards-focused; Harbor adds policy and operators while increasing stateful components.

Likely interviewer follow-ups

  • Why does helm install harbor harbor/harbor -n registry --set expose.type=ingress --set externalURL=https://registry.example.com address Harbor here rather than through application code?
  • How would you distinguish healthy Private Registry from the failure “treating local disk as a durable HA backend, or running garbage collection while manifests are being uploaded and referenced” using push a test digest through OIDC/RBAC, replicate it, run a GC dry plan and restore the registry database plus object store in staging?
  • When would this trade-off-“Distribution is lean and standards-focused; Harbor adds policy and operators while increasing stateful components”-justify a different On-Prem design?
Interview tip: Give one concrete operation-helm install harbor harbor/harbor -n registry --set expose.type=ingress --set externalURL=https://registry.example.com-and one proof-push a test digest through OIDC/RBAC, replicate it, run a GC dry plan and restore the registry database plus object store in staging. Then name the boundary: treating local disk as a durable HA backend, or running garbage collection while manifests are being uploaded and referenced.

Knowledge check

Loading quiz

Put it into practice

Practice related interview Q&A

Apply Self-Hosting Private Container Registries (Docker Registry, Harbor) with generative AI interview Q&A and hands-on practice.

Open DevOps Q&A →Tech Learn Q&A
Previous topic
Container Registries Deep Dive (Docker Hub, GHCR, AWS ECR, GAR, ACR)
Next topic
Authenticating, Pushing & Pulling from Private Registries