How to use docker images filter

后端 未结 7 731
耶瑟儿~
耶瑟儿~ 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:22

    For me,

    docker images -q | while read IMAGE_ID; do
        docker inspect --format='{{.Created}}' --type=image ${IMAGE_ID}
    done
    

    did the trick. The date command is able to produce output in the same format via

    date -Ins --date='10 weeks ago'
    

    which allows me to compare timestamps. I still use the filter for dangling images for convenience, though.

    0 讨论(0)
提交回复
热议问题