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.
Before you start
Section titled “Before you start”- 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.
Push a file with ORAS
Section titled “Push a file with ORAS”1. Log in to the host. oras login takes the host alone. Pipe the token in on standard input:
echo "$CLOUDREPO_TOKEN" | oras login your-org.mycloudrepo.io \ --username you@example.com \ --password-stdinExpected: 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:
oras push your-org.mycloudrepo.io/repositories/your-repo/sbom:v1 \ --artifact-type application/vnd.example.sbom.v1 \ sbom.spdx.json:application/octet-streamExpected: 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:
oras pull your-org.mycloudrepo.io/repositories/your-repo/sbom:v1Expected: 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.
Push a Helm chart
Section titled “Push a Helm chart”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.
echo "$CLOUDREPO_TOKEN" | helm registry login your-org.mycloudrepo.io \ --username you@example.com \ --password-stdinExpected: Login Succeeded.
2. Package the chart. Run this beside your chart’s directory:
helm package chartExpected: 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:
helm push docs-helm-1.0.0.tgz oci://your-org.mycloudrepo.io/repositories/your-repoExpected: 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:
helm pull oci://your-org.mycloudrepo.io/repositories/your-repo/docs-helm --version 1.0.0Expected: 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.
If a command is refused
Section titled “If a command is refused”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.