How to use docker images filter

后端 未结 7 734
耶瑟儿~
耶瑟儿~ 2020-12-08 12:50

I can write

docker images --filter \"dangling=true\"

What other filters can I use?

I can use something like this?

         


        
7条回答
  •  春和景丽
    2020-12-08 13:20

    You can also use the REPOSITORY argument to docker images to filter the images.

    For example, suppose we have the images:

    $ docker images
    REPOSITORY           TAG          IMAGE ID         CREATED         SIZE
    local-foo            latest       17864104b328     2 months ago    100 MB
    example.com/bar      latest       b94c37de2801     9 months ago    285 MB
    example.com/baz      latest       a004e3ac682c     2 years ago     221 MB
    

    We can explicitly filter for all images with a given name:

    $ docker images example.com/bar
    REPOSITORY           TAG          IMAGE ID         CREATED         SIZE
    example.com/bar      latest       b94c37de2801     9 months ago    285 MB
    

    Docker also supports globbing:

    $ docker images "example.com/*"
    REPOSITORY           TAG          IMAGE ID         CREATED         SIZE
    example.com/bar      latest       b94c37de2801     9 months ago    285 MB
    example.com/baz      latest       a004e3ac682c     2 years ago     221 MB
    

    Official docs here.

提交回复
热议问题