Skip to content

skopeo inspect: a way how to avoid fetching all tags from repository #785

Closed

Description

@MartinBasti

Hello,

in our use cases we need to get only information about image, like labels, but we don't need all repoTags. We have repositories with many tags (1700+) and it is resource consuming to get all tags from registry and just drop that.

Could you please provide a way how to avoid fetching repotags?

Thank you

Activity

  1. vrothberg commented on Sep 12, 2019

    @vrothberg
    Contributor

    Thanks for opening the issue, @MartinBasti!

    @baude @rhatdan, that may be something for the next sprint?

  2. rcerven commented on Sep 13, 2019

    @rcerven

    FYI another way how to fetch all tags from quay is also :
    curl -sLk https://quay.io/v1/repositories/organization/repository/tags
    that does return all tags without pagination and seems like in only 1 request

  3. rhatdan commented on Sep 13, 2019

    @rhatdan
    Contributor

    @vrothberg Sure.
    @rcerven Do you know if this works on other registries? Artifactory? Docker.io?

  4. rcerven commented on Sep 13, 2019

    @rcerven

    @rhatdan it is probably specific for quay.io

    main reason for us (@MartinBasti) filing this story is that when we are using skopeo inspect with quay.io
    and we have a lot of tags in repositories, quay actually returns 429 error, because they are limiting number of requests per second

  5. twaugh commented on Sep 17, 2019

    @twaugh

    I guess it would work for any registry that automatically down-converts v2 images to v1 images, right? That's just using the Docker Registry HTTP API V1.

  6. twaugh commented on Oct 3, 2019

    @twaugh

    Any plan to work on this issue?

  7. vrothberg commented on Oct 3, 2019

    @vrothberg
    Contributor

    We have some high priority tasks on our plate at the moment. If the issue is blocking you in some way, we can escalate it to a higher priority but I can't give an ETA.

    Contributions to c/image and c/skopeo are always welcome :)

  8. twaugh commented on Oct 3, 2019

    @twaugh

    Thanks.

  9. nickboldt commented on Oct 21, 2019

    @nickboldt

    Similar request in the opposite direction... I'm trying to query repos for the latest actual tag (not :latest) but if there are a lot of tags, newer ones are not displayed, presumably because of pagination or hashing (they're not necessarily sorted logically).

    And for some repos, this won't ever return (too much data, times out):

    curl -sLk https://registry-p.e.rh.com/v1/repositories/rh-osbs/codeready-workspaces-server-rhel8/tags

    Would it be possible to add a sort/filter option to skopeo inspect so I can ...

    skopeo inspect docker://registry-p.e.rh.com/rh-osbs/codeready-workspaces-server-rhel8 -c 5 to return the last 5 tags?

    Or so I have to start parsing the value of the .Labels.url to get the latest actual tag, eg., skopeo inspect docker://registry-p.e.rh.com/rh-osbs/codeready-workspaces-server-rhel8 | jq .Labels.url ?

  10. mtrmac commented on Nov 1, 2019

    @mtrmac
    Contributor

    Would it be possible to add a sort/filter option to skopeo inspect so I can ...

    skopeo inspect docker://registry-p.e.rh.com/rh-osbs/codeready-workspaces-server-rhel8 -c 5 to return the last 5 tags?

    No, because the server API does not provide any sort/filtering facilities. Skopeo has to list all tags exactly the way curl does (possibly iterating through the returned pages), and it could only do filtering client-side. (As for “last 5 tags”, the tags don’t come with dates and ordering of strings is undefined/unlikely to match all the various uses.)

    If the server times out without returning any useful response, that must be fixed server-side (possibly adding pagination to limit the response size and time, though that might require adding extra indexes to the store, or something like that).

  11. transferred this issue fromcontainers/imageon Dec 10, 2019
  12. lcarva commented on Sep 10, 2020

    @lcarva

    This would be very useful if we want to use skopeo to simply determine the digest of the manfiest. Currently, I don't think there's a way to retrieve this information without also retrieving all the tags in the repository (which is very inefficient for repositories with many tags).

  13. rhatdan commented on Oct 8, 2020

    @rhatdan
    Contributor

    Since this can not be done based on the registry protocol, I think this issue should be close. Reopen if I am mistaken.

  14. mtrmac commented on Oct 8, 2020

    @mtrmac
    Contributor

    Filtering can’t be done, not getting the data at all definitely can be done.

  15. 12 remaining items

  16. lsm5 commented on Sep 29, 2021

    @lsm5
    Contributor

    I'm using skopeo inspect --config <pullspec> if I need information about labels. It's not fetching tags

    @vrothberg @mtrmac is this sufficient to close this, perhaps accompanied with a manpage update?

  17. ktdreyer commented on Sep 29, 2021

    @ktdreyer
    Contributor

    When I run skopeo inspect docker://docker.io/library/python:3.9, I expect to only look at the single "3.9" tag. It works for repos with a few tags, and silently hangs for repos with thousands of tags. I'm already giving skopeo a single tag - why query pages and pages of data from the server just to throw it away? This can trigger rate-limiting on the server, etc.

    It's great that --config shortcuts loading all tags, but I expect new users won't discover this easily. They'll just think skopeo is broken.

  18. mtrmac commented on Oct 2, 2021

    @mtrmac
    Contributor

    I'm using skopeo inspect --config <pullspec> if I need information about labels. It's not fetching tags

    @vrothberg @mtrmac is this sufficient to close this, perhaps accompanied with a manpage update?

    No; it doesn’t allow using any of the other modes.

  19. jaikiran commented on Oct 8, 2021

    @jaikiran
    Contributor

    I've created #1480 to try and address this issue.

  20. ktdreyer commented on Oct 13, 2021

    @ktdreyer
    Contributor

    That PR #1480 uses skopeo inspect --no-tags docker://docker.io/library/python as an example. In that case, the user specified no tag (so does it imply latest, like podman pull does?)

    The issue here is slightly different. skopeo inspect docker://docker.io/library/python:3.9 ought to query that single 3.9 tag without trying to load all other tags.

  21. mtrmac commented on Oct 13, 2021

    @mtrmac
    Contributor

    AFAICS there’s no difference.

    Right now, the list of tags in RepoTags is a list of all tags in the repository, whether or not the CLI input specified a tag (:3.9), a digest @sha256:…), or neither (defaulting to :latest); that part of the CLI input has never affected the RepoTags value, but it did affect all other parts of the output (by choosing which image is inspected).

    The proposed --no-tags option likewise disables collecting and printing the RepoTags value, and doesn’t affect any other part of the input.

    Is there anything I’m missing?

  22. jalbstmeijer commented on Oct 13, 2021

    @jalbstmeijer

    I might have misread where this issue was heading too. I was hoping to get all tags back attached to the specific matching image digest.

    So when an specific image has more tags associated than the one I query for, it would return these and never all tags associated to the repository.

  23. ktdreyer commented on Oct 13, 2021

    @ktdreyer
    Contributor

    @mtrmac Thank you for explaining that. I understand more about how RepoTags currently works now - it's just a plain dump of every tag regardless of input.

  24. mtrmac commented on Oct 13, 2021

    @mtrmac
    Contributor

    I might have misread where this issue was heading too. I was hoping to get all tags back attached to the specific matching image digest.

    So when an specific image has more tags associated than the one I query for, it would return these and never all tags associated to the repository.

    That’s not how I read the original request, and it’s also not something the Registry API allows doing efficiently; the only way to do that is to list all tags, and then, individually one by one, fetch the tag contents to see if they point to the requested digest.

  25. arewm commented on Nov 17, 2021

    @arewm

    Can this issue be closed now that #1480 is merged and 1.5.1 is released?

  26. rhatdan commented on Nov 17, 2021

    @rhatdan
    Contributor

    SGTM

  27. locked as resolved and limited conversation to collaborators on Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions