Registry API used by index.docker.io?

I’m writing some code that should interact with the registry and while it works fine with our private registry, it looks as though the central registry doesn’t speak the protocol as described in the registry api doc (the Tags section). I’m trying to fetch the image id of a tag, and according to the doc, it should return an image id in double-quotes. What index.docker.io is returning for the url

https://index.docker.io/v1/repositories/drewcsillag/skydns/tags/0.3

is

[{“pk”: 1197799, “id”: “2ca3215f”}, {“pk”: 1197798, “id”: “866e63b6”}, {“pk”: 1197797, “id”: “7ac724e3”}, {“pk”: 1197796, “id”: “4f9dccbb”}, {“pk”: 1197795, “id”: “8dc565d9”}, {“pk”: 1197794, “id”: “674f36e7”}, {“pk”: 4948795, “id”: “e54ca5ef”}, {“pk”: 4948794, “id”: “6c37f792”}, {“pk”: 4948793, “id”: “83ff7680”}, {“pk”: 4948792, “id”: “2f4b4d6a”}, {“pk”: 4948791, “id”: “d7ac5e4f”}, {“pk”: 4948852, “id”: “511136ea”}]

Is index talking a new protocol, or how is docker able to pull these things properly? I looked at the docker source, and it doesn’t look like it’s doing anything special…

Likewise, getting the tag list – not a specific tag returns something that looks wrong too:

[{“layer”: “2ca3215f”, “name”: “0.3”}]

Thinking I could just take the layer id and fetch, I tried fetching /v1/images/2ca3215f/json and that didn’t work. Is there some magical header or query arg I should be passing to get doc-conformant behavior? Or is the new protocol documented somewhere?

Thanks,
Drew

Hi, I’m in the same situation, trying to query the registry to check the latest id version of an image before pulling it, but the actual API protocol doesn’t seems to be in sync with the documentation here:

https://docs.docker.com/reference/api/hub_registry_spec/#images

For, example, getting the nginx image tags I get this response:

$ curl -s -L http://registry.hub.docker.com/v1/repositories/nginx/tags
[
  {
    "layer": "637d3b2f",
    "name": "latest"
  },
  {
    "layer": "637d3b2f",
    "name": "1"
  },
  {
    "layer": "637d3b2f",
    "name": "1.7"
  },
  {
    "layer": "61e8f94e",
    "name": "1.7.1"
  },
  {
    "layer": "3f72b0ae",
    "name": "1.7.10"
  },
  {
    "layer": "224873bd",
    "name": "1.7.11"
  },
  {
    "layer": "637d3b2f",
    "name": "1.7.12"
  },
  {
    "layer": "d2d79aeb",
    "name": "1.7.5"
  },
  {
    "layer": "561ed495",
    "name": "1.7.6"
  },
  {
    "layer": "3535cfc9",
    "name": "1.7.7"
  },
  {
    "layer": "e46b3488",
    "name": "1.7.8"
  },
  {
    "layer": "4b5657a3",
    "name": "1.7.9"
  }
]

And if I try to get details of the “latest” branch, this is the response:

curl -s -L http://registry.hub.docker.com/v1/repositories/nginx/tags/latest | jq '.'
[
  {
    "pk": 16888690,
    "id": "637d3b2f"
  },
  {
    "pk": 16888689,
    "id": "073bafc4"
  },
  {
    "pk": 16888688,
    "id": "99d6f687"
  },
  {
    "pk": 16888687,
    "id": "8914754e"
  },
  {
    "pk": 16888686,
    "id": "c30c0312"
  },
  {
    "pk": 16888685,
    "id": "ec83d724"
  },
  {
    "pk": 16888684,
    "id": "f0e620da"
  },
  {
    "pk": 16887214,
    "id": "176085a1"
  },
  {
    "pk": 16887213,
    "id": "6d44bc05"
  },
  {
    "pk": 16887212,
    "id": "0cbe7e43"
  },
  {
    "pk": 16888142,
    "id": "1265e16d"
  },
  {
    "pk": 16888141,
    "id": "4f903438"
  },
  {
    "pk": 16889211,
    "id": "511136ea"
  }
]

Any hint to be able to get the imageID of an specific tagged image?

Thanks