Container images and OCI artifacts
A feed of the type OCI is a container registry: it speaks the OCI Distribution Specification, so docker push and docker pull, Podman, helm push and helm install of OCI charts, and ORAS work with it. It stores container images, multi-platform indexes, Helm charts and any other OCI artifact, such as signatures and SBOMs that refer to an image.
A feed serves one kind of package. Its type is chosen when the feed is created and can't be changed afterwards.
Create an OCI feed​
On Admin > Feeds, press New feed and choose the type OCI (see Managing feeds).
Container clients only look for a registry at /v2/ on its host, so the feed can't live below /feeds/{slug}/ like other feeds. Instead, the feed's slug is the first part of every repository name. An image of the feed images is:
your-server/images/team/app:1.0
where team/app is the repository within the feed. The feed's Connect page shows the registry prefix, your-server/images, with the commands below filled in. One host serves every OCI feed, each with its own permissions.
Clients use a registry over HTTPS. Docker and Podman accept plain HTTP only for localhost or a registry listed as insecure (insecure-registries in Docker's daemon.json, registries.conf for Podman); Helm and ORAS need --plain-http. If PaGetto runs below a path (PathBase), route /v2/ of the host to it, since the clients won't find the registry elsewhere.
Docker and Podman​
Sign in once, then push and pull as with any registry:
docker login your-server -u <username> -p <token>
docker tag my-app:1.0 your-server/images/my-app:1.0
docker push your-server/images/my-app:1.0
docker pull your-server/images/my-app:1.0
Podman takes the same commands. Multi-platform images pushed with docker buildx build --platform ... --push are stored as an index with a manifest per platform, and docker pull picks the one of its platform.
Helm​
Helm 3.8 and later store charts in OCI registries:
helm registry login your-server -u <username> -p <token>
helm push my-chart-0.1.0.tgz oci://your-server/images/charts
helm install my-release oci://your-server/images/charts/my-chart --version 0.1.0
helm push names the repository after the chart (charts/my-chart) and tags it with the chart's version.
ORAS and other artifacts​
ORAS pushes any files as an OCI artifact, and tools such as cosign and Notation attach signatures to images:
oras push your-server/images/my-artifact:1.0 file.txt
oras pull your-server/images/my-artifact:1.0
A manifest whose subject is another manifest (a signature, an SBOM, an attestation) is listed by the referrers API, GET /v2/{feed}/{name}/referrers/{digest}, optionally filtered by artifactType.
Mirror Docker Hub and other registries​
An OCI feed can be a pull-through cache of other registries. Add them on the feed's settings page, under Mirrors, in the order they are asked:
| Registry | Mirror URL | Pull through the feed hub |
|---|---|---|
| Docker Hub | https://registry-1.docker.io | your-server/hub/alpine:3.20, your-server/hub/bitnami/redis |
| GitHub Container Registry | https://ghcr.io | your-server/hub/my-org/app:1.0 |
| One organization of a registry | https://ghcr.io/my-org | your-server/hub/app:1.0 |
- A path in the mirror's URL goes before the repository name. Docker Hub's official images are below
library/, which is added to a name without a slash, soyour-server/hub/alpinepullslibrary/alpine.docker.ioandindex.docker.ioare read asregistry-1.docker.io. - A manifest the feed doesn't have is fetched on its first pull and stored, marked as mirrored. A layer is fetched on its first download, checked against its digest and stored, so the next pull is served by the feed. Of a multi-platform image only the platforms that are pulled are stored.
- A tag stored from a mirror follows the mirror: it is checked with a
HEAD, which Docker Hub doesn't count against its pull limits, at most once per Upstream listing cache duration of the feed (5 minutes by default), and moved when the mirror's tag points at another manifest. When no mirror can be reached, or the mirror no longer has the tag, the stored manifest is served. A tag pushed to the feed itself is never replaced by a mirror's. - The registries answer with a Bearer challenge; the feed gets a token from their token service, anonymously or with the mirror's Basic credentials (a Docker Hub username and access token, or a GitHub username and a token with
read:packages), and keeps it until it expires. A mirror with a Bearer token or custom headers sends them with every request. - A layer is downloaded completely before it is served, so a large layer needs a Download timeout long enough for it (600 seconds by default).
- Mirror cache retention removes mirrored manifests that were not pulled for that many days; the garbage collection then removes their layers.
- Tags lists, the catalog and the referrers API show what the feed has stored, not the mirror's.
Authentication​
Container clients don't send credentials with each request. /v2/ answers 401 with a WWW-Authenticate: Bearer challenge that names the token endpoint, /v2/token; the client asks it for a token with its credentials, and sends the token from then on. docker login, helm registry login and oras login store the credentials and do this for you.
With Authentication:Mode set to Local, Entra, Oidc, Saml or Hybrid, the credentials are a username and a personal access token, or a local or LDAP account's password. A token is valid for an hour, and the permissions are checked on every request: the account needs the pull permission on the feed to pull, push to push and delete to delete (see Feed permissions). A signed-in caller without the pull permission gets 404, as for a feed that doesn't exist.
With the Legacy mode, any username and one of the configured Credentials sign in to pull, and an API key as the password signs in to push. A server without credentials needs no sign-in to pull.
The tokens are encrypted with Data Protection, so every replica that shares the key ring accepts them.
How the feed stores content​
- A repository is a package of the feed, and a manifest one of its versions, named by its digest (
sha256:…). A tag points at a manifest; pushing a manifest with a tag moves the tag. Tags are always movable: the feed's overwrite setting doesn't apply to them. - Blobs (the layers and configs of images) are content-addressed and shared by all repositories of a feed, below
oci/{feed}/blobs/sha256/in the storage. A layer that the feed has already is not uploaded again, and mounting a blob from another repository of the same feed succeeds at once. - Uploads are stored chunk by chunk below
oci/{feed}/uploads/in the configured storage, so they work on every storage provider and with several replicas. The blob is written once the client completes the upload and its digest is checked. A blob may be as large as the feed's Max package size; a manifest at most 4 MiB. - A manifest is accepted once every blob it references, and every manifest an index references, is in the feed.
Delete and garbage collection​
DELETE /v2/{feed}/{name}/manifests/<digest> deletes a manifest and its tags, and DELETE /v2/{feed}/{name}/manifests/<tag> removes only the tag (the delete permission). The package page has a Delete button for a manifest too. With the recycle bin on, a deleted manifest goes there first.
Blobs are not deleted directly. The OCI garbage collection job (see Admin > Background jobs) runs five minutes after startup and then hourly. It removes the blobs that no manifest of the feed references, manifests in quarantine and in the recycle bin included, once they have been unreferenced for an hour: a client uploads the blobs of an image before its manifest, so a new blob has no manifest yet. Uploads that were not completed within 24 hours are removed too. Run now on that page starts it at once.
Web UI​
The feed's page lists its repositories. A repository's page shows its manifests (newest first, with their tags), the layers of an image or the platforms of an index, the tags, and the docker pull, helm install or oras pull command of the manifest.
API​
Every answer has Docker-Distribution-API-Version: registry/2.0; errors are the JSON errors of the specification ({"errors":[{"code":"MANIFEST_UNKNOWN","message":…}]}), which the clients show.
| Endpoint | |
|---|---|
GET /v2/ | 200 with a token or credentials, else 401 with the challenge |
GET /v2/token | A token for the Basic credentials, or an anonymous one without them |
GET /v2/_catalog?n=&last= | The repositories of every OCI feed the caller may pull, with the feed's slug |
GET/HEAD /v2/{feed}/{name}/manifests/<tag or digest> | A manifest, with its media type and Docker-Content-Digest |
PUT /v2/{feed}/{name}/manifests/<tag or digest> | Pushes a manifest (push permission); 201 with Location |
DELETE /v2/{feed}/{name}/manifests/<tag or digest> | Deletes a manifest or a tag (delete permission); 202 |
GET/HEAD /v2/{feed}/{name}/blobs/<digest> | A blob, with range requests |
POST /v2/{feed}/{name}/blobs/uploads/ | Starts an upload (202), stores a blob sent with ?digest= (201), or mounts one with ?mount=<digest>&from=<name> (201) |
PATCH /v2/{feed}/{name}/blobs/uploads/<id> | Adds a chunk, with an optional Content-Range |
PUT /v2/{feed}/{name}/blobs/uploads/<id>?digest= | Completes an upload, with an optional last chunk |
GET/DELETE /v2/{feed}/{name}/blobs/uploads/<id> | The upload's progress, or cancels it |
GET /v2/{feed}/{name}/tags/list?n=&last= | The tags, in lexical order, paged with a Link header |
GET /v2/{feed}/{name}/referrers/<digest>?artifactType= | The manifests that refer to a manifest |
Limitations​
- Only SHA-256 digests are supported, which every common client uses.
- Promotion to another feed is not available for OCI feeds, since it would not copy the blobs.
- Retention limits don't apply to OCI feeds; delete manifests and let the garbage collection remove their blobs.
- With a cloud storage provider, checking whether a blob exists reads the blob, so a
HEADof a large layer is slower than on the file system.