How can I list all tags for a Docker image on a remote registry?

前端 未结 19 2002
时光取名叫无心
时光取名叫无心 2020-12-04 04:46

How can I list all tags of a Docker image on a remote Docker registry using the CLI (preferred) or curl?

Preferably without pulling all versions from the remote regi

19条回答
  •  广开言路
    2020-12-04 05:25

    curl -u : https://$your_registry/v2/$image_name/tags/list -s -o - | \
        tr -d '{' | tr -d '}' | sed -e 's/[][]//g' -e 's/"//g' -e 's/ //g' | \
        awk -F: '{print $3}' | sed -e 's/,/\n/g'
    

    You can use it if your env has no 'jq', = )

提交回复
热议问题