# Harbor vs Docker Hub: Registro self-hosted vs público

> Harbor vs Docker Hub para CI: registro self-hosted da CNCF com scanning e RBAC vs o registro público hospedado. Qual armazena suas imagens de container.

Source: https://latchkey.dev/pt/learn/tool-comparisons/harbor-vs-docker-hub  
Updated: 2026-06-26

O Harbor é um registro de containers self-hosted da CNCF com scanning, assinatura e RBAC embutidos; o Docker Hub é o registro público hospedado e marketplace de imagens.

O Harbor é um registro open-source e self-hosted que adiciona scanning de vulnerabilidades, assinatura de imagens, replicação e RBAC granular - voltado para empresas que querem controle. O Docker Hub é o registro público padrão que hospeda imagens oficiais e da comunidade, com repositórios privados e conveniência, mas com rate limits e menos governança interna.

## Comparison

|  | Harbor | Docker Hub |
| --- | --- | --- |
| Hospedagem | Self-hosted | SaaS público |
| Scanning / assinatura | Embutido | Limitado / add-on |
| RBAC | Granular | Básico |
| Replicação | Sim | Limitada |
| Melhor para | Controle enterprise | Imagens públicas, início rápido |

## No CI

O Docker Hub é conveniente para fazer pull de imagens base e públicas e hospedagem privada rápida, mas fique atento aos rate limits de pull no CI. O Harbor oferece um registro que você controla, com scanning, assinatura, RBAC e replicação - forte para pipelines com foco em segurança ou air-gapped. Muitos times fazem proxy do Docker Hub através do Harbor para cachear imagens e evitar rate limits.

## Acelere

Faça cache e proxy das imagens upstream para driblar os limites de pull e aquecer as layers. Pulls e pushes rodam em CI runners; runners gerenciados mais rápidos encurtam etapas pesadas em imagens.

## Decide with your own numbers, not a feature table

Feature comparisons age badly and rarely decide anything, because both tools in a mature category can do the job. What differs is how each behaves on your repository, and that takes one afternoon to measure.

```Terminal
# time a cold install with each candidate, cache cleared
hyperfine --prepare "rm -rf node_modules" --warmup 1 \
  "<tool-a> install" "<tool-b> install"

# and the thing CI actually pays for: a cold run with no local cache
docker run --rm -v "$(pwd):/w" -w /w node:22 sh -c "<tool> install"
```

> Measure the cold path. Warm local benchmarks favour whichever tool you already have cached, which is exactly the condition a CI runner never has.

## What actually changes when you switch

- Lockfile format. A switch is a one-way door for anyone still on the old tool until everyone migrates, so plan it as a single coordinated change.
- Resolution strictness. Tools differ on whether an undeclared transitive import works, and the stricter one will surface latent bugs as new failures.
- CI cache configuration. The cache path and key differ per tool; carrying over the old ones silently disables caching.
- Everyone on the team and every runner must move together. Pin the version so they cannot drift.

## O veredito

Quer um registro controlado com scanning, assinatura e RBAC: Harbor. Quer o registro público para imagens base/da comunidade e hospedagem rápida: Docker Hub. A dor com limites de pull no CI muitas vezes leva os times a fazer proxy do Hub via Harbor.

## FAQ

### Harbor vs Docker Hub: Self-Hosted vs Public Registry?

Harbor is an open-source, self-hosted registry adding vulnerability scanning, image signing, replication, and fine-grained RBAC - aimed at enterprises that want control. Docker Hub is the default public registry hosting official and community images, with private repos and convenience, but rate limits and less in-house governance.

### In CI?

Docker Hub is convenient for pulling base and public images and quick private hosting, but watch pull rate limits in CI. Harbor gives you a registry you control with scanning, signing, RBAC, and replication - strong for security-conscious or air-gapped pipelines.

### Speed it up?

Cache and proxy upstream images to dodge pull limits and warm layers. Pulls and pushes run on CI runners; faster managed runners shorten image-heavy steps.

### Which should I choose?

Want a controlled registry with scanning, signing, and RBAC: Harbor. Want the public registry for base/community images and quick hosting: Docker Hub. Pull-limit pain in CI often pushes teams to proxy Hub via Harbor.

---

Latchkey runs CI/CD that repairs its own failures. Agent entry points: https://latchkey.dev/agent.txt, https://latchkey.dev/openapi.json, https://latchkey.dev/llms.txt
