1.Docker Images
2.Show untagged images
From <https://docs.docker.com/engine/reference/commandline/images/>
-q 是只显示ID
3.显示TAG为DEV的image:
现在通过2和3已经获取到所有repository不含microsoft的image ID了,用docker images rmi 删除即可
E.g.
$ docker rmi $(docker images -f "dangling=true" -q)
From <https://docs.docker.com/engine/reference/commandline/images/>
4.如何一次性删除所有repository不含microsoft的image
$c=docker images -q
$d=docker images "microsoft/*" -q
比较两个集合
Diff $c $d -IncludeEqual
用循环
这样就取出了所有不包含microsoft的repository的ID了。
Diff $c $d -IncludeEqual | where{$_.SideIndicator -ne "=="} | foreach{docker rmi -f $_.InputObject}
删的时候可能会报错,先把占用的container删了就好了