How to use docker images filter

后端 未结 7 744
耶瑟儿~
耶瑟儿~ 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.

提交回复
热议问题