Skip to content

OCI Artifacts with ORAS and Helm

CloudRepo is an OCI registry. Your Docker repository holds your container images. It also holds a file you push with ORAS, and a Helm chart. One repository token covers both tools. This page shows you how.

  • A Docker repository to hold the artifacts. For the steps to create one, see Creating a Repository.
  • A repository token that reaches it. Choose Download and publish packages when you push. To create one, follow Repository Tokens. The token is the password, and the username is your account email address.
  • ORAS, installed, and Helm if you push a chart. The ORAS commands below were run with ORAS 1.3.3, and the Helm commands with Helm 4.2.4.

Used on this page only, never saved. Never enter a token or password here.

1. Log in to the host. oras login takes the host alone. Pipe the token in on standard input:

Terminal
echo "$CLOUDREPO_TOKEN" | oras login your-org.mycloudrepo.io \
--username you@example.com \
--password-stdin

Expected: Login Succeeded.

2. Push the file. The reference is the host, the literal repositories/ segment, your repository, and then a name and a tag for the artifact. --artifact-type says what the artifact is. The text after the file’s colon is the media type of the file:

Terminal
oras push your-org.mycloudrepo.io/repositories/your-repo/sbom:v1 \
--artifact-type application/vnd.example.sbom.v1 \
sbom.spdx.json:application/octet-stream

Expected: Pushed [registry] your-org.mycloudrepo.io/repositories/your-repo/sbom:v1, then an ArtifactType: line and a Digest: line.

3. Pull it back. Run this in an empty directory. ORAS writes the file there under the name you pushed it with:

Terminal
oras pull your-org.mycloudrepo.io/repositories/your-repo/sbom:v1

Expected: Pulled [registry] your-org.mycloudrepo.io/repositories/your-repo/sbom:v1 and a Digest: line, and sbom.spdx.json in the current directory, byte for byte the file you pushed.

Helm stores a chart as an OCI artifact, so a chart goes in the same kind of repository with the same token. Helm has its own login, and it addresses a chart with an oci:// reference. This page gives the four commands. For the rest, see Helm Charts (OCI).

1. Log in to the host.

Terminal
echo "$CLOUDREPO_TOKEN" | helm registry login your-org.mycloudrepo.io \
--username you@example.com \
--password-stdin

Expected: Login Succeeded.

2. Package the chart. Run this beside your chart’s directory:

Terminal
helm package chart

Expected: Successfully packaged chart and saved it to: .../docs-helm-1.0.0.tgz. The file name is the chart’s name and version from Chart.yaml.

3. Push to the repository. The address ends at the repository. Helm adds the chart’s name and its version as the tag:

Terminal
helm push docs-helm-1.0.0.tgz oci://your-org.mycloudrepo.io/repositories/your-repo

Expected: Pushed: your-org.mycloudrepo.io/repositories/your-repo/docs-helm:1.0.0 and a Digest: line.

4. Pull. helm pull takes the chart, so this address ends with its name, and the version is a flag:

Terminal
helm pull oci://your-org.mycloudrepo.io/repositories/your-repo/docs-helm --version 1.0.0

Expected: Pulled: your-org.mycloudrepo.io/repositories/your-repo/docs-helm:1.0.0 and a Digest: line, and docs-helm-1.0.0.tgz in the current directory.

Start with Troubleshooting on the Docker page. Two checks come first. The reference carries the literal repositories/ segment after the host, and the token has Download and publish packages access when you push.

View as Markdown