0

How to get the docker image when has been pulled with skopeo inspect?

When I use skopeo inspect --tls-verify=false docker://${image_path}:${tag} --config I can only find the key value "created" without "pulled". If skopeo is not OK, curl should be OK.

finalha
  • 1
  • 3

1 Answers1

0

The pulled date is not part of the spec. The pull date is only in Harbor and skopeo is only spec compliant. Using curl, harbor-cli or api client will do it.

Vad1mo
  • 5,156
  • 6
  • 36
  • 65
  • 1
    Thanks for your reply. Finally I use curl to do it. The script is in below: #get the image_artifacts and change to url format Image_artifacts=$(printf ${Image#*/}|jq -sRr '@uri'|sed 's|%2F|%252F|g') curl -u $Harbor_User:$Harbor_Passwd -H "Content-Type: application/json" -X GET "http://${Harbor_Address}/api/v2.0/projects/$Project/repositories/${Image_artifacts}/artifacts?page_size=100"|jq '.[]|select (.pull_time>"2023-02-06")'|jq '.tags[].name' – finalha Feb 07 '23 at 03:47
  • You should answer your own question. It’s better then just commenting on mine – Vad1mo Feb 08 '23 at 06:05