Store full image reference during oras backup
What is the version of your ORAS CLI
1.3.0
What would you like to be added?
I would like the full image reference to be stored in the image during oras backup.
I can see a few ways of accomplishing this:
- We could add the entire image reference to
org.opencontainers.image.title. - If we have an appetite for breaking changes, we could simply add the entire image reference to
org.opencontainers.image.ref.name - We could add the tag to
org.opencontainers.image.ref.nameand the base name toorg.opencontainers.image.base.name
Why is this needed for ORAS?
As a maintainer of an air-gap packaging tool called Zarf, I would like Zarf to be able to automatically determine the name of images stored in image tars that my user's add to their package. The docker save command for instance always stores the full image reference under io.containerd.image.name so even if users have images from 10 different repositories, Zarf will know the reference for each when it pushes these images to the air-gap registry.
I would be happy to implement this, however I do not know which annotation strategy the oras project would like to use.
Are you willing to submit PRs to contribute to this feature?
- [x] Yes, I am willing to implement it.
@shizhMSFT @Wwwsylvia @sajayantony Maintainers, please take a look. cc: @FeynmanZhou
This issue should be marked with "feature request".
@TerryHowe @FeynmanZhou It is a sub scenario of backing up / restoring multiple repositories across registries.
Interesting alternatives proposed.
To review the alternatives I attempted:
- Tag each image with original registry/repository:tag or repository:tag
- Store artifacts backed up in directories based on repository name
One other alternative I was going to look at is add an SBOM to the backup that would correlate the images to the repository or registry/repository.
Pretty much a duplicate of https://github.com/oras-project/oras/issues/730 but this is a smaller subset of the problem in #730
Sounds like a valid scenario! @AustinAbro321 thanks for proposing this. We will assign this issue to you.
I personally vote for adding the entire image reference to org.opencontainers.image.title. This looks like more consistent with the OCI image spec.
I went with a simple solution in #1904 of only adding the annotation during backup. This is good enough for my purposes, and to close this issue.
I am curious if there should be a broader stance by oras. As a consumer of oras-go it seems like functions like oras.Copy() expect the entire reference under org.opencontainers.image.ref.name, however this doesn't align with oras backup