Post

Add private pull-through cache projects for Docker Hub, GHCR, and Quay in Harbor bootstrap

Add private pull-through cache projects for Docker Hub, GHCR, and Quay in Harbor bootstrap

I extended the Harbor PostSync bootstrap to declare three private pull-through cache projects—proxy-dockerhub, proxy-ghcr, and proxy-quay—so workloads can pull public upstream images through Harbor without a prior catalog entry or publication workflow.

Declare proxy caches in bootstrap.py with idempotent reconciliation

The bootstrap module now defines a PROXY_CACHES dictionary mapping each cache project to its upstream URL and Harbor replication adapter (docker-hub, docker-registry, quay). A new find_registry helper handles Harbor’s quirk of serializing an empty registry slice as null, and create_registry separates creation from reconciliation. The reconcile_proxy_caches function ensures each cache project exists, is marked private, inherits the seven-day retention policy, and has automatic scanning and SBOM generation enabled. All three caches connect anonymously with TLS verification.

Extend CI checks to recognize proxy cache digests and validate adapter allowlists

The harbor-images-check.py script gained a proxy_digest function that matches digest-pinned image references served by the declared cache projects. Runtime verification now treats proxy cache pulls as allowed without prior publication. The render check parses the rendered bootstrap ConfigMap with ast to extract PROXY_CACHES, then verifies every adapter appears in the harbor-core ConfigMap’s REPLICATION_ADAPTER_WHITELIST. Tests cover the new registry lookup behavior, proxy digest recognition, and adapter allowlist mismatches.

Document the migration path for workloads

Both docs/harbor-image-mirroring.md and openwiki/operations/harbor-oci.md now describe the pull-through cache pattern: authenticate to Harbor with a principal that has pull access to the cache project, use the project’s repository prefix, and verify a complete authenticated pull of a digest absent from that cache before migrating workloads from the current mirror prefix. The docs note that scan and SBOM results should be checked separately from pull verification.

Pattern for zero-catalog image availability

This design lets a team serve public upstream images through a private registry without maintaining a publication catalog for every tag. The bootstrap stays the source of truth for which upstreams are cached, the render check prevents adapter drift, and the image check treats cache pulls as a first-class supply-chain path. The same pattern transfers to any Harbor deployment that needs on-demand access to Docker Hub, GHCR, Quay, or other registries with compatible replication adapters.

This post is licensed under CC BY 4.0 by the author.