Docker Registry and Harbor
Store container images in XNS storage with the open-source Distribution registry or Harbor.
Overview
The Distribution registry (the registry image on Docker Hub) is the reference container image registry. Harbor is the CNCF registry built on it, adding projects, users, scanning and replication. Both keep image layers and manifests through Distribution’s s3 storage driver. With XNS, that storage is a bucket on your Relayer.
Tested with Distribution registry 3.1.2 and Harbor 2.15.4 on 2026-10-18 against Relayer build 59a37e64.
The run pushed an image with a 64 MiB layer, pulled it with a client that had no local copy, and compared the manifest digest and every layer’s SHA-256 with what was pushed: identical. The registry ran once over HTTP on port 9000 and once over HTTPS on port 9443 with a trusted certificate, with and without redirects. Deleting the image through the registry API and running garbage collection removed its layers from the bucket. Harbor ran the same push and pull over HTTP.
Connect to XNS
Every S3 tool connects to your Relayer with the same settings. Enter them exactly as shown; the notes below the table cover the two that most tools get wrong by default.
| Setting | Value |
|---|---|
| Endpoint (HTTP) | http://<relayer-host>:9000, where <relayer-host> is the address of the machine running your Relayer. Always available. |
| Endpoint (HTTPS) | https://<relayer-host>:9443, available only after a certificate is installed on the Relayer. Port 9000 never serves HTTPS. |
| Region | us-east-1 |
| Addressing | Path-style. In tools that ask, turn on force path style or path-style access, and turn off virtual-hosted style. |
| Signature | Signature Version 4 (V4). Version 2 is refused. |
| Access key and secret key | For a tool, create a scoped key: IAM → Create IAM User in the Relayer UI. The secret is shown once, so copy it then. The install’s root pair is on Configure → Credentials; keep it for administration. |
| Bucket | Create it first: Files → Create Bucket in the Relayer UI, or let the tool create it. Names are 3-63 characters of lowercase letters, digits, hyphens and periods. |
HTTPS and certificates. The Relayer UI offers two certificates for port 9443: Let’s Encrypt, which needs a domain managed in Cloudflare and a Cloudflare API token, or self-signed. Most tools refuse a self-signed certificate unless certificate verification is turned off in the tool. On a private network, plain HTTP on port 9000 avoids the question.
Path-style. A tool left on virtual-hosted style (often labeled Amazon S3 or AWS) sends the bucket name in the hostname, and the Relayer cannot find the bucket. Choose the tool’s S3 compatible or generic S3 option and set path-style.
Not supported: server-side encryption with customer-provided keys (SSE-C) or KMS keys (SSE-KMS), bucket website hosting and bucket replication. Server-side encryption with AES256 is accepted. See Encryption at the Gateway, Identity and Access and Configure.
Prerequisites
- The
registry:3image, or Harbor 2.x from its installer. - A bucket and a scoped key on your Relayer (see the table above).
- Network access to
<relayer-host>from the registry, and from the machines that pull images unless redirects are turned off (below).
Distribution registry
Mount this as /etc/distribution/config.yml in the registry:3 container. These are the settings from the tested run, with the keys replaced by placeholders.
version: 0.1
storage:
s3:
accesskey: <access key>
secretkey: <secret key>
region: us-east-1
regionendpoint: http://<relayer-host>:9000
forcepathstyle: true
bucket: <bucket>
rootdirectory: /registry
delete:
enabled: true
redirect:
disable: false
http:
addr: :5000| Field | Value |
|---|---|
regionendpoint | http://<relayer-host>:9000, or https://<relayer-host>:9443 once a certificate is installed |
forcepathstyle | true. The default is false, which puts the bucket name in the hostname. |
region | us-east-1 |
rootdirectory | Optional folder inside the bucket |
redirect.disable | false sends pulls straight to the Relayer; true streams them through the registry (see below) |
delete.enabled | true to allow deleting manifests through the API |
Signing uses Signature Version 4 by default; no setting is needed.
Harbor
In harbor.yml, before running ./install.sh (or ./prepare on an existing install), add a storage_service block with the same fields:
storage_service:
s3:
accesskey: <access key>
secretkey: <secret key>
region: us-east-1
regionendpoint: http://<relayer-host>:9000
forcepathstyle: true
bucket: <bucket>
rootdirectory: /harbor
redirect:
disable: falseFor a Relayer certificate your Harbor hosts do not trust, the same block takes a ca_bundle path to the CA certificate; that case was not tested.
Check it
docker push <registry-host>/<repository>:<tag>
docker pull <registry-host>/<repository>:<tag>The digest that docker push prints must match the one docker pull reports. Test the pull on a machine that does not already hold the image’s layers, or Docker reuses its local copy. Listing the bucket shows layers under docker/registry/v2/blobs/.
Pulls go straight to the Relayer
With redirect.disable: false (the default), the registry answers each layer download with a redirect to a presigned URL on <relayer-host>, so every machine that pulls must resolve and reach the Relayer at the address in regionendpoint. With redirect.disable: true, the registry downloads the layers from the Relayer and streams them itself; in the tested run both modes returned identical layers.
Delete images and reclaim space
Distribution: delete the manifest through the API (DELETE /v2/<repository>/manifests/<digest>, with delete.enabled: true), then run registry garbage-collect --delete-untagged /etc/distribution/config.yml, ideally with the registry stopped or read-only. In the tested run this removed every layer of the deleted image from the bucket.
Harbor: delete the artifact, then run garbage collection under Administration → Clean Up. Harbor’s garbage collection skips layers uploaded in the last two hours, so a test right after a push frees nothing.
Known limits
- Harbor was tested over HTTP only. It uses the same storage driver as the Distribution registry, which also passed over HTTPS.
- HTTPS needs port 9443 and an installed certificate. A self-signed certificate was not tested; both the registry and every machine following a redirect would have to trust it.
- The bucket stays after you remove the registry. A scoped key can empty a bucket but not delete it.
- Not supported by the Relayer: SSE-C and SSE-KMS server-side encryption (leave the driver’s
keyidunset) and bucket replication. Harbor’s own registry replication works at the registry level and does not need it, but it was not tested.
