# Harbor vs Docker Hub: self-hosted vs パブリックレジストリ

> CI のための Harbor vs Docker Hub: スキャンと RBAC を備えた self-hosted な CNCF レジストリ vs パブリックなホスト型レジストリ。どちらがコンテナイメージを保存するか。

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

Harbor はスキャン、署名、RBAC を組み込んだ self-hosted な CNCF コンテナレジストリで、Docker Hub はパブリックなホスト型レジストリ兼イメージマーケットプレイスです。

Harbor は脆弱性スキャン、イメージ署名、レプリケーション、きめ細かい RBAC を追加するオープンソースの self-hosted レジストリで - 制御を求めるエンタープライズ向けです。Docker Hub は公式およびコミュニティのイメージをホストするデフォルトのパブリックレジストリで、プライベートリポジトリと利便性を備えますが、レートリミットがあり社内ガバナンスは弱めです。

## Comparison

|  | Harbor | Docker Hub |
| --- | --- | --- |
| ホスティング | self-hosted | パブリック SaaS |
| スキャン / 署名 | 組み込み | 限定的 / アドオン |
| RBAC | きめ細かい | 基本的 |
| レプリケーション | あり | 限定的 |
| 最適な用途 | エンタープライズの制御 | パブリックイメージ、手早い開始 |

## CI では

Docker Hub はベースやパブリックのイメージの pull と手早いプライベートホスティングに便利ですが、CI での pull レートリミットに注意しましょう。Harbor はスキャン、署名、RBAC、レプリケーションを備え、あなたが制御するレジストリを提供します - セキュリティ重視や air-gapped なパイプラインに強力です。多くのチームは Harbor を通じて Docker Hub をプロキシし、イメージを cache してレートリミットを回避します。

## 高速化

上流イメージを cache しプロキシして、pull リミットを回避し layer を温めておきましょう。pull と push は CI runner 上で実行され、より高速なマネージド runner はイメージの多いステップを短縮します。

## 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.

## 結論

スキャン、署名、RBAC を備えた制御されたレジストリが欲しいなら Harbor。ベース/コミュニティイメージと手早いホスティングのためのパブリックレジストリが欲しいなら Docker Hub。CI での pull リミットの痛みから、チームがしばしば Harbor 経由で Hub をプロキシするようになります。

## 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
