Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is that possible to get image ID from Docker Registry V2?

When an image has been pushed to registry V2, does the image ID will be pushed to registry as well? Is that possible to get image ID for a certain repository from V2 registry?

like image 375
Haoming Zhang Avatar asked Jun 10 '16 23:06

Haoming Zhang


1 Answers

If the image was pushed with Docker Client 1.10 or above, you can obtain the image ID from the registry with

GET /v2/<image>/manifests/<tag> 

Your request must include the header

Accept: application/vnd.docker.distribution.manifest.v2+json

In the response, the image ID will be in the Content-Docker-Digest Response header.

like image 87
drs Avatar answered Oct 13 '22 02:10

drs