How to get a list of images on docker registry v2

前端 未结 16 1774
孤城傲影
孤城傲影 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:19

    If some on get this far.

    Taking what others have already said above. Here is a one-liner that puts the answer into a text file formatted, json.

    curl "http://mydocker.registry.domain/v2/_catalog?n=2000" | jq . - > /tmp/registry.lst
    

    This looks like

    {
      "repositories": [
        "somerepo/somecontiner",
        "somerepo_other/someothercontiner",
     ...
      ]
    }
    

    You might need to change the `?n=xxxx' to match how many containers you have.

    Next is a way to automatically remove old and unused containers.

提交回复
热议问题