You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a docker load-able tar, the manifest contains a RepoTags field, which can list multiple different image references. When you docker load the tar, docker images then displays the image multiple times, named with each of the tags found in RepoTags.
Is there an equivalent way to do this in an OCI archive? I see index.json can use an org.opencontainers.image.ref.name annotation, but that only accepts one image name, not a list.
@TadCordle this can be accomplished by listing the descriptor multiple times, once per tag. Since the underlying content is the same, the duplication only occurs in the index.json and nothing else is duplicated.
We (on containerd) explored a few different options here to make the OCI format compatible with Docker's, this ultimately ended up being the cleanest. The containerd export code now generates an archive which can both be loaded back into existing Docker versions (1.10+) as well as future version which will support loading the OCI archives directly.
I've been using podman to try to test running the OCI images I'm generating, and it seems to have issues with this sort of index. Using podman load < image.tar with multiple manifests entries:
open /var/tmp/podman675604817/manifest.json: not a directory
Using podman pull oci-archive:image.tar:
error loading index: more than one image in oci, choose an image
Do you think these are issues with podman, or the index.json I'm writing?
The index looks valid, I would file an issue there as I am sure that is a case intended to work. I am not familiar with their UX though if there other expected ways to support that, supporting the archives has been tricky from a CLI UX perspective.
Since this doesn't seem to be a problem with the spec, I'll close this for now and keep an eye on podman-container-tools/podman#4646. Thanks for the help!
Yeah this is a limitation of containers/image -- though it should be noted that skopeo does have a way to set repoTags through a CLI option (but because of the containers/image limitation it can't look at the index to figure out what the repoTags should be).
Activity
dmcgowan commentedon Dec 4, 2019
@TadCordle this can be accomplished by listing the descriptor multiple times, once per tag. Since the underlying content is the same, the duplication only occurs in the index.json and nothing else is duplicated.
We (on containerd) explored a few different options here to make the OCI format compatible with Docker's, this ultimately ended up being the cleanest. The containerd export code now generates an archive which can both be loaded back into existing Docker versions (1.10+) as well as future version which will support loading the OCI archives directly.
TadCordle commentedon Dec 4, 2019
To be sure, are you suggesting listing the same manifest multiple times in
index.json, like this?I've been using podman to try to test running the OCI images I'm generating, and it seems to have issues with this sort of index. Using
podman load < image.tarwith multiplemanifestsentries:Using
podman pull oci-archive:image.tar:Do you think these are issues with podman, or the
index.jsonI'm writing?dmcgowan commentedon Dec 4, 2019
The index looks valid, I would file an issue there as I am sure that is a case intended to work. I am not familiar with their UX though if there other expected ways to support that, supporting the archives has been tricky from a CLI UX perspective.
TadCordle commentedon Dec 4, 2019
Since this doesn't seem to be a problem with the spec, I'll close this for now and keep an eye on podman-container-tools/podman#4646. Thanks for the help!
cyphar commentedon Dec 5, 2019
Yeah this is a limitation of
containers/image-- though it should be noted thatskopeodoes have a way to setrepoTagsthrough a CLI option (but because of thecontainers/imagelimitation it can't look at the index to figure out what therepoTagsshould be).