Skip to content

Commit

Permalink
feature: Add remote registry referrers example
Browse files Browse the repository at this point in the history
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
  • Loading branch information
TerryHowe committed Aug 1, 2024
1 parent c1b8e35 commit cb1c5f3
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions versioned_docs/version-1.2/how_to_guides/remote_registries.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,26 @@ hello world
%
```

## Referencing an artifact

Use the [`oras attach`](/commands/oras_attach.mdx) command to add a reference to another artifact.

```bash
oras attach ghcr.io/${GHCR_USER}/my-repository:v1 --artifact-type 'doc/example' --annotation 'key=val' ref-artifact.txt
```

The output will look something like this:
```
✓ Uploaded ref-artifact.txt 13/13 B 100.00% 490ms
└─ sha256:9e820c753b29c9ea7b85a7d1b9d88107330d625546c216facba451effe1b8dbd
✓ Exists application/vnd.oci.empty.v1+json 2/2 B 100.00% 0s
└─ sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a
✓ Uploaded application/vnd.oci.image.manifest.v1+json 746/746 B 100.00% 930ms
└─ sha256:a461956f5500056ca03ee325c4c607ef421dfff6ad1902eeb2da67686c62004b
Attached to [registry] ghcr.io/my_github_username/my-repository@sha256:b557297d52ec1bee854717827994fb616bffe936c583c7ce66fb21eb0c557df6
Digest: sha256:a461956f5500056ca03ee325c4c607ef421dfff6ad1902eeb2da67686c62004b
```

## View referrers

Use [`oras discover`](/commands/oras_discover.mdx) to view referrers.
Expand All @@ -95,4 +115,6 @@ oras discover ghcr.io/${GHCR_USER}/my-repository:v1
The output will look something like this:
```
ghcr.io/my_github_username/my-repository@sha256:b557297d52ec1bee854717827994fb616bffe936c583c7ce66fb21eb0c557df6
└── doc/example
└── sha256:a461956f5500056ca03ee325c4c607ef421dfff6ad1902eeb2da67686c62004b
```

0 comments on commit cb1c5f3

Please sign in to comment.