Docker Community Forums

Share and learn in the Docker community.

Order of tags in REST api


(Anatoly Popov) #1

Hi.

Can I rely on order of tags in this endpoint (https://hub.docker.com/v2/repositories/org-name/repo-name/tags/?page=1&page_size=250)? Right now it seems that they are sorted by last_updated field.

Or is there any way to find a tag based on sha of local build image?

Thanks.


(Littlecolin) #2

I would also like to know if this is possible - we currently tag our images with two tags - a commit SHA and a semantic version. I need to be able to find out the semantic version given a commit SHA and vice versa - at the moment the v2/repo/tags/list returns all tags with no way I can see to group them together to identify an image. Perhaps tags could be included in the manifest?

A workaround may be to combine the commit SHA and semantic version together into a single tag.


(Shoeper) #3

The order of tags is not defined. I’d interpret it as it can always change.