How can I find a Docker image with a specific tag in Docker registry on the Docker command line?

前端 未结 10 1197
小蘑菇
小蘑菇 2020-12-12 18:21

I try to locate one specific tag for a Docker image. How can I do it on the command line? I want to avoid downloading all the images and then removing the unneeded ones.

10条回答
  •  南方客
    南方客 (楼主)
    2020-12-12 18:31

    Add this function to your .zshrc file or run the command manually:

    #usage list-dh-tags 
    #example: list-dh-tags node
    function list-dh-tags(){
        wget -q https://registry.hub.docker.com/v1/repositories/$1/tags -O -  | sed -e 's/[][]//g' -e 's/"//g' -e 's/ //g' | tr '}' '\n'  | awk -F: '{print $3}'
    }
    

    Thanks to this -> How can I list all tags for a Docker image on a remote registry?

提交回复
热议问题