We use the following API to find if the repo and tag is available on the hub for download. Only if it returns a response suggesting so, we go for a docker pull.
Error condition:
Command -
curl -i -X GET https://registry.hub.docker.com/v1/repositories/nginx/tags/latest
Response
HTTP/1.1 404 NOT FOUND
Server: nginx/1.6.2
Date: Fri, 10 Jun 2016 05:13:29 GMT
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked
X-Frame-Options: SAMEORIGIN
Strict-Transport-Security: max-age=31536000
Tag not found
==================================================
But when we execute the following command, it works
Command -
curl -i -X GET https://registry.hub.docker.com/v1/repositories/nginx/tags/1.9
Response:
HTTP/1.1 200 OK
Server: nginx/1.6.2
Date: Fri, 10 Jun 2016 05:14:47 GMT
Content-Type: application/json
Transfer-Encoding: chunked
X-Frame-Options: SAMEORIGIN
Strict-Transport-Security: max-age=31536000
[{“pk”: 21662675, “id”: “0e181a34”}, {“pk”: 21662676, “id”: “aa527287”}, {“pk”: 21662677, “id”: “cc90a59a”}, {“pk”: 21662678, “id”: “251bbadf”}, {“pk”: 21662679, “id”: “6f88661d”}, {“pk”: 21665286, “id”: “1f3613e1”}, {“pk”: 21665285, “id”: “c7fb0a07”}, {“pk”: 21665284, “id”: “ab998deb”}]
Since I can see the tag - “latest” to be available for nginix when I check on the hub, what could be the reason for the curl command to send back a response saying “Tag not found” ?
Any suggestions?