Skip to content

OCI archive-equivalent to "RepoTags" #796

Closed

Description

@TadCordle

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.

Activity

  1. dmcgowan commented on Dec 4, 2019

    @dmcgowan
    Member

    @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.

  2. TadCordle commented on Dec 4, 2019

    @TadCordle
    Author

    To be sure, are you suggesting listing the same manifest multiple times in index.json, like this?

    {
      "schemaVersion": 2,
      "manifests": [
        {
          "mediaType": "application/vnd.oci.image.manifest.v1+json",
          "digest": "sha256:abcd....",
          "size": 1000,
          "annotations": {
            "org.opencontainers.image.ref.name": "image:tag"
          }
        },
        {
          "mediaType": "application/vnd.oci.image.manifest.v1+json",
          "digest": "sha256:abcd....",  <-- (same digest)
          "size": 1000,
          "annotations": {
            "org.opencontainers.image.ref.name": "image:differenttag"
          }
        }
      ]
    }
    

    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?

  3. dmcgowan commented on Dec 4, 2019

    @dmcgowan
    Member

    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.

  4. TadCordle commented on Dec 4, 2019

    @TadCordle
    Author

    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!

  5. cyphar commented on Dec 5, 2019

    @cyphar
    Member

    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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions