Repository navigation
Description
What is the version of your ORAS CLI
v1.2.0
What would you like to be added?
Extend the ORAS annotating capabilities to support:
- Annotate a multi-arch image using OCI image index:
oras manifest index create/update --annotation - Attach a referrer to a parent image index and propagate to platform-specific image manifest:
oras attach --annotation "key=value" --platform linux/amd64 --platform windows/amd64
Attach an annotation as a referrer to an existing multi-arch image and its child arch-specific image manifest (without mutating its digest) in one shot. The same annotation is supposed to be added to the parent image index and its child arch-specific image manifest recursively:
oras attach --artifact-type application/vnd.artifact.lifecycle --annotation "vnd.artifact.lifecycle.end-of-life.date=2023-05-12" --platform all --oci-layout layout-dir:v1
Attached to [oci-layout] layout-dir@sha256:2af402374d4c9297bf077b1e722d52
Digest: sha256:117308d626166e77ffbd9c76b5545101b723csdcxcxc2344556642
Attached to the child image manifest layout-dir@sha256:aaaaaaaaaaaaaaaaa
Digest: sha256:bbbbbbbbbbbbbbbbb
Attached to the child image manifest layout-dir@sha256:ccccccccccccccccc
Digest: sha256:dddddddddddddddddView attached annotations of the multi-arch image (index) and its child image manifest:
$ oras discover --oci-layout layout-dir:v1 --format tree
|--Image index
| layout-dir@sha256:447c006400aae8b0d302cafba172f5da9889d50af085ad51d
| └── application/vnd.artifact.lifecycle
| └── sha256:b25b53b7df86a5dc7087cf96ed88fd1d8872271422224d7
| └── vnd.artifact.lifecycle.end-of-life.date: "2023-05-12
|
|--Image manifest [1]
| layout-dir@sha256:447c006400aae8b0d302caf9d50af089d50af089d50af089d
| └── application/vnd.artifact.lifecycle
| └── sha256:b25b53b7df86a5dc7087cf96ed88fd1d8872271422224d7
| └── vnd.artifact.lifecycle.end-of-life.date: "2023-05-12"
|
└--Image manifest [2]
layout-dir@sha256:447c006400aae8b0d302cafba172f5da9889d50af085ad51d
└── application/vnd.artifact.lifecycle
└── sha256:b25b53b7df86a5dc7087cf96ed88fd1d8872271422224d7
└── vnd.artifact.lifecycle.end-of-life.date: "2023-05-12"
Why is this needed for ORAS?
Scenario: A security engineer Cindy needs to use image lifecycle annotations to mark when the image should be considered end of life (EoL) and no longer used by dependent services.
However, as there are multi-arch images and separate arch-specific images maintained by service teams, it is cumbersome that Cindy can only apply annotations manually to each arch-specific image. Image consumers only reference the multi-arch image by a tag for deployment. The EoL annotation is not available on the multi-arch image (index), which makes the multi-arch image (index) unverifiable.
Are you willing to submit PRs to contribute to this feature?
- Yes, I am willing to implement it.


Activity
tarilabs commentedon Nov 27, 2024
Hi, I noticed this github-issue and speaks of
oras manifest createcommand, but I can't seeoras manifest create...can you kindly direct me to where I can read more about it, please?
FeynmanZhou commentedon Dec 5, 2024
Hi @tarilabs , thanks for your interest.
oras manifest index createis still in themainbranch. You may need to manually build it on your machine to test it. Just follow this guidance to build a dev binary and try the latest experimental feature: https://oras.land/community/developer_guide.FeynmanZhou commentedon Dec 5, 2024
@tarilabs I have a draft specification to walk through the desired experience of creating and updating a multi-arch image (index). I would appreciate if you could take a look at this spec: #1514
[-]Extend the ORAS annotating capabilities in oras attach and oras manifest[/-][+]Extend the ORAS annotating capabilities in oras attach[/+]wangxiaoxuan273 commentedon Mar 20, 2025
After offline discussion, the scope of this issue now is to support giving multiple platforms in
oras attach --platform.oras manifest index create --annotationis on the main branch and ready for use.wangxiaoxuan273 commentedon Mar 24, 2025
Created a basic PoC in #1669. Run after build:
oras attach --artifact-type doc/example --platform linux/386 --platform linux/mips64le --platform linux/ppc64le my.registry.io/test:latest --annotation "key1=val1" --annotation "key2=val2"wangxiaoxuan273 commentedon Apr 16, 2025
According to the discussion in the community meeting on April 16, 2025, no new implementation is needed for the scenario of attaching EOL annotations to multi-platform image. The user can run
oras attachmultiple times. Enabling using--platformflag multiple times does not improve much user experience.nickharris commentedon Sep 17, 2025
Many consumers don't have knowledge of or need to understand the composition of the manifest, they are just a simple consumer of a container image. Without this feature the consumer has to break out into shell script to write code to pull the manifest and iterate over the images calling oras attach. Introducing --platform argument is provides the convenience that people generally expect from a cli, saves the extra code and enables simple consumers to just keep moving without having to understand manifest composition