Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

Order docker images tag list by created date



  • Hi,

    There is an API method called /tag/list which returns this unordered tag list.
    Are you able to add a query string parameter ?order=date to produce a result ordered at least by tag created date? I don't think it should be that challenging to do and I do see the benefits of getting the TAGs ordered according to the Date they were created..

    In my honest opinion, it should by default order by created date. I shouldn't even need to provide the query string. That way it would be even easier to implement.

    af16bcb0-bbd4-484e-896e-62492f6f060c-image.png


  • inedo-engineer

    hello;

    I assume you're referring to the Docker feeds Docker API's implementation?

    https://docs.docker.com/registry/spec/api/#listing-image-tags

    The docs don't give a great clue, but it does say "ordered lexically", which it seems ProGet's API follows. We can't really add parameters, and changing behavior might break things that otherwise expect this order.

    But I do agree the order doesn't' make much sense; we just followed the API. If you can find evidence find how other implementers handle ordering differently (DockerHub, etc.), we can consider to change it.

    Cheers,
    Alana



  • @atripp The main goal for me is to be able to fetch the latest tag for a particular docker image so I can display in a custom badge.
    For NuGets I have the API shown below:

    Get Latest Version number of a package:
    https://«proget-server»/nuget/{feed-name}/Packages()?$filter=Id%20eq%20%27«package-name»%27%20and%20IsAbsoluteLatestVersion&$top=1

    For docker images I would like to query based on the tag list to get the last one created but I can't seem to find a good option to do with this API if there is no ordering capabilities. It should be a simple requirement to query a docker image and get the last created tag.


  • inedo-engineer

    @nuno-guerreiro-rosa_9280 the API you referenced is the "NuGet v2 API", and we simply follow the specification when we implement their API.

    In the same way, we follow the Docker API specification, which does not provide a way to query a docker image in the way you'd like. I think you have a good point, but it's not our specification or decision, but Docker's

    There's not much of a demand for a ProGet-proprietary API for packages at this time, but if you can help us understand the value of this, then we can better considering it - https://inedo.com/open/feature-requests


Log in to reply
 

Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation