How to find the image creation date in the (private) Docker registry (API v2)?

I would like to know the latest timestamp for an image in the private Docker registry using API v2 without first pulling the image to my local host.

+4
source share
1 answer

So, after some hacking, I used the following tools, using tools curland jq:

curl -X GET http://registry:5000/v2/<IMAGE>/manifests/<TAG> \
    | jq -r '.history[].v1Compatibility' \
    | jq '.created' \
    | sort \
    | tail -n1

This seems to work, but I really don't know how to interpret the v1 compatibility view, so I don't know if I really get the correct number from this.

Comments on this are welcome!

+7
source

Source: https://habr.com/ru/post/1607619/


All Articles