Docker Community Forums

Share and learn in the Docker community.

Question about searching image tags via api

dockerhub

(Ilcic) #1

I have a question about https://hub.docker.com. I have pushed an image to my hub.docker account but I cannot get the image tags via api version 1.

For example, I have an ubuntu image in ilcic/ubuntu with tag “haha”, but I get an empty array with

curl https://registry.hub.docker.com/v1/repositories/ilcic/ubuntu/tags
[]

while api version 2 works. I can get tag “haha” with

curl https://registry.hub.docker.com/v2/repositories/ilcic/ubuntu/tags/
{"count": 1, "next": null, "previous": null, "results": [{"name": "haha", "full_size": 65838625, "id": 3388217, "repository": 738797, "creator": 668914, "last_updater": 668914, "last_updated": "2016-06-11T12:33:20.214821Z", "image_id": null, "v2": true, "platforms": [5]}]}

But on the other hand I cannot get anything via api version 2 by searching official ubuntu image

curl https://registry.hub.docker.com/v2/repositories/ubuntu/tags/
404 page not found

and api version 1 works…

curl https://registry.hub.docker.com/v1/repositories/ubuntu/tags
[{"layer": "594b6e30", "name": "latest"}, {"layer": "3db9c44f", "name": "10.04"} ......

I am very curious about the policy of registry api. Which version should I use?