如何将Docker镜像列表与标记列表关联起来,都是通过API返回的?

你可以使用curl https://index.docker.io/v1/repositories/ubuntu/images来产生{ {"checksum": "", "id": "76ca2fd907879906ba5c936738ccce0b577590040ac8d288f07afb3d34ae8b03"}, ... }

也可以使用curl https://index.docker.io/v1/repositories/ubuntu/tags来产生{ {"layer": "5ba9dab4", "name": "latest"}, {"layer": "3db9c44f", "name": "10.04"}, ... }

你现在怎么能将图像ID与标签名称关联起来? 你能依靠项目的顺序吗? 你可以从速记图层ID获取图像ID?

layer是图像ID的前8个字符。