我正在使用docker,我发现当我运行
docker images -a
我有大量没有标签的图像,或者至少它们有一个标签
<none>
这些在我的磁盘上浪费了太多空间,现在 df -h 告诉我我的根目录已满。
我潜伏在互联网上,发现
docker rmi -f $(docker images -a | grep "^<none>" | awk '{print $3}')
至少会遍历所有没有的,但随后我会收到一大堆错误消息。
Error: response from daemon: Conflict, <id> wasn't deleted
Error: response from daemon: Conflict, <id> wasn't deleted
Error: response from daemon: Conflict, <id> wasn't deleted
Error: response from daemon: Conflict, <id> wasn't deleted
etc...
Error: failed to remove images: [<list of all the image ids that I want gone>]
这变得有些烦人。有谁知道这些没有标记的图像是什么,为什么我的命令没有摆脱它们?