# OCI Artifacts with ORAS and Helm

> Use CloudRepo as your OCI registry. Push and pull a file with ORAS and a chart with Helm, in a Docker repository, with exact commands.

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

- A Docker repository to hold the artifacts. For the steps to create one, see [Creating a Repository](/docs/manage/repositories.html#creating-a-repository).
- A repository token that reaches it. Choose **Download and publish packages** when you push. To create one, follow [Repository Tokens](/docs/authenticate/repository-tokens.html). The token is the password, and the username is your account email address.
- ORAS, [installed](https://oras.land/docs/installation/), 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.

> **Note:** Use a repository token as the password, not the password you use to log in to the admin portal.

## Push a file with ORAS

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

**Terminal**

```bash
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**

```bash
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**

```bash
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.

## 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)](/docs/formats/helm.html).

**1. Log in to the host.**

**Terminal**

```bash
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**

```bash
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**

```bash
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**

```bash
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.

## If a command is refused

Start with [Troubleshooting](/docs/formats/docker.html#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.

---

The page: https://www.cloudrepo.io/docs/formats/oci-artifacts.html
