docker registry v2 : get parent image name -


i parent of current image using docker registry api v2. possible ?.

i trying construct tree structure of docker images parent/child relationship need parent of each docker image. can repositories using /v2/_catalog & manifest each repository /v2//manifests/latest, couldn't figure out how parent out of it.

any appreciated.

if examine manifest of image should see blocks of "v1compatibility" sections in json output.

if @ those, should see base image information. example when ran on 1 of images, derived centos 7:

curl --insecure https://myregistry:5000/v2/imagename/manifests/latest | grep -i centos 

i see:

[...] "v1compatibility": "{\"id\":\"172ab63cd5e007f8b1dbd7659c2d9520bf9e50755c081f39d171a603ad5d0890\",\"parent\":\"0c908fa575ec22f872f78b12d9e57d132b67a683f7deacd9f02462c546bf52dd\",\"created\":\"2016-04-01t21:28:21.706982438z\",\"container_config\":{\"cmd\":[\"/bin/sh -c #(nop) label name=centos base image vendor=centos license=gplv2 build-date=2016-03-31\"]}}" "v1compatibility": "{\"id\":\"3690474eb5b4b26fdfbd89c6e159e8cc376ca76ef48032a30fa6aafd56337880\",\"created\":\"2015-09-07t19:05:48.678585881z\",\"container_config\":{\"cmd\":[\"/bin/sh -c #(nop) maintainer centos project \\u003ccloud-ops@centos.org\\u003e\"]}}" [...] 

parsing should give information want.


Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -