Docker and OCI Repositories, Connectors, Registry Paths, Authentication, Layers, and Image Metadata: Configuration, Design Choices, and Tradeoffs
Choose Docker/OCI routing and repository policy deliberately: path-based routing versus connectors, Docker versus native OCI repositories, mutable tags versus digest-pinned deployment, authentication, proxy scope, group order, and storage tradeoffs.
Learning objectives
- Choose between native OCI and Docker repository formats based on artifact needs and existing client/upstream behavior.
- Compare path-based, port, subdomain, and reverse-proxy routing by operational cost and security boundaries.
- Use immutable tags and digest-pinned deployment appropriately without confusing them with provenance.
- Design authenticated push and read policy with least privilege and isolated client credential storage.
- Explain how group order, upstream proxying, local client cache, and Nexus blob reuse affect reliability and supply-chain risk.
1. Native OCI versus Docker repository format
Nexus 3.94 introduced native OCI repositories in addition to the established Docker format. Both can serve container images to compatible tools, but native OCI is the better mental model when your artifact set includes image indexes, Helm charts, SBOMs, signatures, attestations, and OCI 1.1 referrers. Existing Docker repositories remain appropriate when you depend on Docker-format-specific features, Docker Hub index behavior, ECR proxy configuration, or an established estate you do not need to redesign.
| Decision | Docker repository format | Native OCI repository format |
|---|---|---|
| Container images | Supported, including OCI 1.0.x image compatibility. | Supported; designed around OCI Distribution/Image concepts. |
| Hosted / proxy / group | Supported. | Supported from 3.94.0. |
| Supply-chain OCI artifacts | Some OCI image compatibility, but Docker-centered model. | OCI 1.1 Referrers API for signatures, SBOMs, attestations and other artifacts. |
| Docker Hub-specific proxy/index controls | Mature Docker-specific configuration. | Generic OCI proxy remote such as registry-1.docker.io. |
| Mandatory course path | Concepts and diagnostics. | Used for the free local lab because it is current and Community-compatible. |
2. Path-based routing versus dedicated connectors
Routing determines how a registry client maps a hostname/path/port to a repository. Path-based routing reduces listener/port sprawl and is Sonatype's preferred modern approach for Docker, and the only Cloud routing mode. Port connectors remain valid self-hosted endpoints but create operational overhead as repositories multiply. Reverse-proxy routing moves mapping/TLS/headers into another component, which can be useful but increases the diagnostic surface.
| Choice | Maintainability | Security / TLS | Failure signature |
|---|---|---|---|
| Path-based | One host/port, repo name in image path. | Simpler certificates and firewalling; still requires correct client support and HTTP/TLS policy. | Wrong path often becomes 404/manifest unknown or auth-scope mismatch. |
| Port connector | Simple for a few repositories; poor scaling with many ports. | Each listener must be exposed and secured; plain HTTP needs explicit client trust/insecure config. | Connection refused/wrong repository when port mapping is wrong. |
| Subdomain | Readable names, but DNS/certificate administration. | Often needs wildcard/SAN TLS; native OCI subdomain routing is Pro. | DNS/TLS hostname mismatch, wrong host mapping. |
| Reverse proxy mapping | Central routing logic, no Nexus connector explosion. | Proxy must preserve host/forwarded scheme and TLS correctly. | 401 loops, wrong Location/WWW-Authenticate URLs, 404, hostname mismatch. |
4. Anonymous pull versus authenticated push
Public base-image caches may be readable anonymously on an isolated network, while internal images often require authenticated reads. Writes should be authenticated and least-privilege. For self-hosted Docker/OCI clients, the bearer-token realm must be active. A browser login session does not automatically supply CLI credentials.
Container clients persist credentials in config/auth files. In
developer environments, use a credential helper/store where
supported. In CI, inject a dedicated service credential via the CI
secret mechanism and log in with --password-stdin.
Never bake a registry password/token into a Dockerfile layer, image
label, build argument that becomes image history, or committed
config.json.
5. Proxying public versus private registries
A proxy improves availability and reduces repeated upstream
transfers, but it also becomes a policy boundary. For Docker Hub,
the classic Docker proxy format has explicit registry/index
configuration. Native OCI proxy repositories can use
https://registry-1.docker.io as a remote. Nexus 3.95
adds support for long-lived IAM and short-lived STS credentials when
Docker proxy repositories authenticate to Amazon ECR; that is a
version-specific feature, not a generic OCI assumption.
Credential boundary: upstream proxy credentials belong to Nexus server configuration and must be protected/rotated. Client push credentials belong to the developer/CI identity. Do not reuse one credential for both roles.
6. Group order and namespace ownership
Group order is a supply-chain decision. If
learner-example/ch08-app is internal, hosted should
precede the public proxy so a public collision cannot shadow it
inside the group. That alone is not a complete defense: controlled
network egress and routing rules should prevent clients from
bypassing Nexus and pulling a same-named image directly from public
registries.
7. Blob reuse versus repository identity
Content-addressed layers are naturally reusable when the same digest appears in multiple images. Reuse reduces storage and transfer, but it does not collapse repository policy. Two repositories can point at content that shares blob bytes while still having different authorization, retention, tag, or routing semantics. Never “optimize” storage by manually deduplicating or deleting Nexus blob files.
8. Availability versus freshness
A proxy cache can keep previously fetched public image content available during an upstream outage. That does not guarantee an uncached tag or newly moved tag can resolve. A digest-pinned image already cached in Nexus has a stronger availability story than a moving tag whose current manifest has never been cached. Record whether an incident affects name resolution/metadata, manifest retrieval, or layer retrieval rather than saying “Docker is down.”
9. Worked design scenario
A 40-developer team uses internal images under corp/*,
pulls open-source bases from Docker Hub, deploys to Kubernetes, and
wants one read endpoint. They have Nexus Community on a private VM
and no requirement for SSO or HA yet.
| Requirement | Decision | Why / observable evidence |
|---|---|---|
| One read endpoint |
Native OCI group oci-public with internal
hosted first, public proxy second.
|
Client pulls show one route; Nexus repository evidence identifies which member stored/served content. |
| Internal publication | Publish directly to OCI hosted. | Avoids Pro-only writable Docker/npm group semantics and keeps the authoritative write lane explicit. |
| Exact deployment | CI records manifest digest; Kubernetes manifests pin digest for production. | Rollback/redeploy selects exact manifest even if a human tag later changes. |
| Routing | Path-based through one trusted HTTPS host in production. | Avoids connector-port sprawl and simplifies certificate/firewall management. |
| Auth | Dedicated CI publisher; developers read via least-privilege account or controlled anonymous policy. | Nexus token scope and privileges are auditable separately from UI sessions. |
| Upstream control | Only Nexus may reach Docker Hub; clients cannot bypass it. | Closes alternate route that could evade cache/routing/policy controls. |
10. Decision checklist
- Which image namespaces are authoritative internally?
- Which upstream registries must be proxied, and which credentials do those upstreams require?
- Are tags immutable, channel-like, or mixed by policy?
- Will runtime deployment record/pin a manifest digest?
- Which routing mode is supported by your exact Nexus version/edition and client fleet?
- Where are client credentials stored and rotated?
- Can any build/runtime bypass Nexus and reach public registries directly?
- What evidence proves which repository member served an image during an incident?
Knowledge check
Why might native OCI be preferable for a new supply-chain artifact platform?
It supports OCI-native hosted/proxy/group workflows plus multi-architecture indexes and OCI 1.1 referrers for signatures, SBOMs, attestations, and other artifacts.
Why is path-based routing generally easier to operate than dozens of port connectors?
It reuses one host/listener and places repository identity in the path, reducing listener, firewall, and certificate sprawl.
If a production deployment records only app:prod, what is missing?
The resolved manifest digest. The tag may be mutable, so the record does not uniquely identify the deployed manifest.
Does shared layer storage mean authorization can be ignored for one of the repositories?
No. Blob reuse is a storage/content-addressing behavior; repository authorization and policy remain separate.
What is the strongest dependency-confusion defense for internal image namespaces?
Combine internal-hosted-first group order with controlled client configuration/routing rules and network egress that prevents direct public bypass.
Official references and version notes
- Nexus Repository Download and 3.95.0 release notes — current downloadable self-hosted baseline for this chapter.
- Sonatype: Docker Registry — Docker registry paths, routing methods, API support, and self-hosted connector guidance.
- Sonatype: Docker Authentication — Docker Bearer Token Realm, login behavior, and anonymous-access prerequisites.
- Sonatype: OCI Repositories, Create an OCI Repository, and Configure OCI Repository.
- Sonatype: OCI CLI Usage — Docker/Podman/OCI-compatible client examples.
- Sonatype: Proxy Repository for Docker and reverse-proxy strategies.
- Docker: docker image pull — tag versus digest pulls and layer reuse.
- OCI Image Manifest Specification and OCI Image Configuration.
Version-sensitive statements were rechecked against Sonatype,
Docker, and OCI primary documentation on 2026-08-26. The mandatory
lab assumes self-hosted Nexus Repository Community Edition 3.95.0,
Java 21 on the Nexus side, native OCI repositories introduced in
Nexus 3.94.0, and a current Docker-compatible client. Record
docker version or podman version locally;
client behavior evolves independently of Nexus. Re-check the live
release and format documentation before executing the lab.
Keep the academy open
Support free, practical DevOps education.
Every lesson is designed to remain readable in a browser, downloadable from GitHub, and usable without a paid learning platform. Contributions help expand and maintain the curriculum.
0x716c4Ab160C4B66F31a28AE2448BfF68fc3a2ef0
Send only Ethereum/ERC-20 compatible assets to this
address.