Skip to content

Support showing more information of "oras repo tags" in formatted output #1547

Closed as duplicate

Description

@FeynmanZhou

What is the version of your ORAS CLI

v1.2.0

What would you like to be added?

When listing the tags in an OCI image layout or an repo of the OCI registry. The corresponding digest and mediatype of each tagged manifest should be listed alongside the tags in the output.

$ oras repo tags registry.k8s.io/busybox --format json

{
    "child": [],
    "manifest": {
        "sha256:4bdd623e848417d96127e16037743f0cd8b528c026e9175e22a84f639eca58ff": {
            "mediaType": "application/vnd.docker.distribution.manifest.v1+prettyjws",
            "tag": [
                "1.24"
            ],
            "timeUploadedMs": "1660289007063",
            "timeCreatedMs": "0",
            "imageSizeBytes": "0"
        },
        "sha256:545e6a6310a27636260920bc07b994a299b6708a1b26910cfefd335fdfb60d2b": {
            "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
            "tag": [
                "1.27",
                "1.27.2"
            ],
            "timeUploadedMs": "1660289009344",
            "timeCreatedMs": "1505297656620",
            "imageSizeBytes": "693833"
        },
        "sha256:d8d3bc2c183ed2f9f10e7258f84971202325ee6011ba137112e01e30f206de67": {
            "mediaType": "application/vnd.docker.distribution.manifest.v1+prettyjws",
            "tag": [
                "latest"
            ],
            "timeUploadedMs": "1660289016474",
            "timeCreatedMs": "0",
            "imageSizeBytes": "0"
        }
    },
    "name": "k8s-artifacts-prod/images/busybox",
    "tags": [
        "1.24",
        "1.27",
        "1.27.2",
        "latest"
    ]
}

Why is this needed for ORAS?

  • With the media type of each tag showing in the formatted output, users should be able to differentiate from an image index and image manifest in a repo
  • Easier to users to list all available tags with their descriptor in a repo, so that users can compose an image index by selecting from a few arch-specific tags
  • For scripting and automation scenario

Are you willing to submit PRs to contribute to this feature?

  • Yes, I am willing to implement it.

Activity

  1. added
    enhancement
    triage
    on Nov 26, 2024
  2. added this to the v1.3.0-beta.2 milestone on Nov 27, 2024
  3. added
    spec required
    and removed
    triage
    on Nov 27, 2024
  4. added
    question
    experimental
    on Jan 21, 2025
  5. shizhMSFT commented on Jan 21, 2025

    @shizhMSFT
    Contributor

    Besides the output formatting minor issues, there is a perf concern: if a repo has hundreds of tags, this command will appear to hang without any response.

  6. tommyjcarpenter commented on May 15, 2025

    @tommyjcarpenter

    I found this issue after RTFM at https://oras.land/docs/commands/oras_repo_tags/

    This is tangentially but not directly related. I was going to open a feature request to be able to give a table with the ability to sort by tag push date. We have repos with thousands of tags, and we often want to get "the latest" where latest isnt alphabetical, but by push date. Eg something like

    oras repo tags --sort-by time --order desc --N 100
    

    to give me the last 100 tags sorted by the most recent tag to come into existence.

    Even less is not of much help, because the "latest" tag could be a hash smack in the middle of the alphabetical sorting

  7. changed the title [-]Support showing more information of tags in formatted output[/-] [+]Support showing more information of "oras repo tags" in formatted output[/+] on May 23, 2025
  8. Wwwsylvia commented on May 28, 2025

    @Wwwsylvia
    Member

    +1 on supporting --format json for oras repo tags.

    Besides the output formatting minor issues, there is a perf concern: if a repo has hundreds of tags, this command will appear to hang without any response.

    We can start with outputting the raw JSON response from the registry. For example:

    $ oras repo tags docker.io/library/hello-world --format json
    {
        "name": "library/hello-world",
        "tags": [
            "latest",
            "linux",
            "nanoserver",
            "nanoserver-1709",
            "nanoserver-1803",
            "nanoserver-1809",
            "nanoserver-ltsc2022",
            "nanoserver-ltsc2025",
            "nanoserver-sac2016",
            "nanoserver1709"
        ]
    }

    This would enable users to extract fields from the output and ensure compatibility with potential non-standard registry responses, such as those from registry.k8s.io:

    $ oras repo tags registry.k8s.io/busybox --format json
    {
        "child": [],
        "manifest": {
            "sha256:4bdd623e848417d96127e16037743f0cd8b528c026e9175e22a84f639eca58ff": {
                "mediaType": "application/vnd.docker.distribution.manifest.v1+prettyjws",
                "tag": [
                    "1.24"
                ],
                "timeUploadedMs": "1660289007063",
                "timeCreatedMs": "0",
                "imageSizeBytes": "0"
            },
            "sha256:545e6a6310a27636260920bc07b994a299b6708a1b26910cfefd335fdfb60d2b": {
                "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
                "tag": [
                    "1.27",
                    "1.27.2"
                ],
                "timeUploadedMs": "1660289009344",
                "timeCreatedMs": "1505297656620",
                "imageSizeBytes": "693833"
            },
            "sha256:d8d3bc2c183ed2f9f10e7258f84971202325ee6011ba137112e01e30f206de67": {
                "mediaType": "application/vnd.docker.distribution.manifest.v1+prettyjws",
                "tag": [
                    "latest"
                ],
                "timeUploadedMs": "1660289016474",
                "timeCreatedMs": "0",
                "imageSizeBytes": "0"
            }
        },
        "name": "k8s-artifacts-prod/images/busybox",
        "tags": [
            "1.24",
            "1.27",
            "1.27.2",
            "latest"
        ]
    }

    Additionally, we can consider supporting --format json for oras repo ls as well, since catalog capability falls into the same "content discovery" category as tag listing and referrers listing. The UX would be similar:

    $ oras repo ls localhost:5000 --format json
    {
        "repositories": [
            "foo",
            "bar"
        ]
    }
  9. FeynmanZhou commented on May 28, 2025

    @FeynmanZhou
    MemberAuthor

    I found this issue after RTFM at https://oras.land/docs/commands/oras_repo_tags/

    This is tangentially but not directly related. I was going to open a feature request to be able to give a table with the ability to sort by tag push date. We have repos with thousands of tags, and we often want to get "the latest" where latest isnt alphabetical, but by push date. Eg something like

    oras repo tags --sort-by time --order desc --N 100
    

    to give me the last 100 tags sorted by the most recent tag to come into existence.

    Even less is not of much help, because the "latest" tag could be a hash smack in the middle of the alphabetical sorting

    @tommyjcarpenter Thanks. Would you mind creating another issue as a new feature request? You use case sounds a valid scenario.

  10. tommyjcarpenter commented on May 30, 2025

    @tommyjcarpenter

    @FeynmanZhou moved here by request: #1747

  11. self-assigned this
    on Jun 11, 2025
  12. shizhMSFT commented on Jul 8, 2025

    @shizhMSFT
    Contributor

    @FeynmanZhou moved here by request: #1747

    Succeeded by #1747

  13. modified the milestones: v1.3.0-beta.4, future on Jul 8, 2025
  14. added
    duplicate
    and removed
    question
    spec required
    on Jul 8, 2025
  15. TerryHowe commented on Oct 22, 2026

    @TerryHowe
    Member

    Duplicate of #1747, which superseded this request.

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

Metadata

Metadata

Assignees

Labels

duplicateenhancementexperimental

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions