Self-Hosting Private Container Registries (Docker Registry, Harbor)
Run a private registry or Harbor for on-prem control, scanning, and policies.
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.comfor 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
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.
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, 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.
Exercise this failure safely: treating local disk as a durable HA backend, or running garbage collection while manifests are being uploaded and referenced.
How it works, step by step
Step 1 of 41. 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.
- 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 stagingin 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
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.
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.
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.comas proof and skippingpush 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.comaddress 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?
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
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.