B M
B M

Reputation: 4019

How to correlate Docker image list with tag list both as returned by API?

One can do curl https://index.docker.io/v1/repositories/ubuntu/images which yields { {"checksum": "", "id": "76ca2fd907879906ba5c936738ccce0b577590040ac8d288f07afb3d34ae8b03"}, ... }

One can also do curl https://index.docker.io/v1/repositories/ubuntu/tags which yields { {"layer": "5ba9dab4", "name": "latest"}, {"layer": "3db9c44f", "name": "10.04"}, ... }

How can you now correlate the image IDs with the tag names? Can you rely on the order of the items? Can you get the image id from the shorthand layer id?

Upvotes: 0

Views: 54

Answers (1)

Andy
Andy

Reputation: 38187

The layer is the first 8 characters of the image id.

Upvotes: 2

Related Questions