How to get a list of images on docker registry v2

前端 未结 16 1763
孤城傲影
孤城傲影 2020-12-02 04:04

I\'m using docker registry v1 and I\'m interested in migrating to the newer version, v2. But I need some way to get a list of images present on registry; for example with re

16条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-02 04:29

    Here is a nice little one liner (uses JQ) to print out a list of Repos and associated tags.

    If you dont have jq installed you can use: brew install jq

    # This is my URL but you can use any
    REPO_URL=10.230.47.94:443
    
    curl -k -s -X GET https://$REPO_URL/v2/_catalog \
     | jq '.repositories[]' \
     | sort \
     | xargs -I _ curl -s -k -X GET https://$REPO_URL/v2/_/tags/list
    

提交回复
热议问题