oras
oras copied to clipboard
Add platform flag to attach command
What is the version of your ORAS CLI
Version: 1.0.0-rc.1+unreleased Go version: go1.20 Git commit: 8bda262f901e8ef8404cf23d59c5f47f4280fdf3 Git tree state: clean
What would you like to be added?
Right now, if I have a multi-arch image, I need this to attach a file to each arch.
oras attach... --oci-layout oci@digestofthearch
I would like to be able to do something like this.
oras attach .... --platform linux/s390x --oci-layout oci:dev
Why is this needed for ORAS?
Right now, I have a multi-arch image, and it will be more intuitive to attach an artefact to an arch with the platform flag, especially when we can discover and cp with the platform flag.
Are you willing to submit PRs to contribute to this feature?
- [ ] Yes, I am willing to implement it.
Thanks for providing this great idea. It should be added to oras so user won't need to find the digest of a certain arch by themselves.
cc @FeynmanZhou
@SamirPS I would like to understand a little bit more about your scenario. As far as I understand you would like to attach an artifact to each arch image. My assumption is that you want to build the following structure:
- multiArch image (this is the manifest index)
- x86 image (this is the image manifest for x86 image)
- artifact n:1 attached to the x86 image
- arm image (this is the image manifest for arm image)
- artifact n:2 attached to the x86 image
- x86 image (this is the image manifest for x86 image)
Is my assumption correct?
Hello @toddysm Yeah, your assumption is correct, just that the artifact n:2 is attached to arm not x86
Apologies - copy and paste mistake on my side :)
This is possible right now although it requires a bit more elaborate steps. You should directly attach to the manifest that is for this particular architecture instead to the index manifest. You can easily get that by pulling the index manifest and getting a reference to the arch specific manifest using jq. Let me know if you need more details about how to do that.
One principle we are trying to follow with ORAS to make it agnostic to the artifacts that are pushed. Using architecture in the command is very specific to container image artifact types and goes against this principle.
Your request though prompts some interesting ideas for some future capabilities like the following:
oras attach... --property "architecture: arm" ...
It is a very rough idea, and it will need to go over more thorough design discussions because I can see quite a few issues with this right now that can go wrong.
You talk about doing
Oras attach repo:tag@digestofarm for example ? Right now I'm using it.
And i understand your point of view and yeah I thinks it's will need more discussion
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.
Any news about this issue?
Any news about this issue?
@shizhMSFT @FeynmanZhou @sajayantony for planning
Linking #834