我有一个未标记容器的列表:
dockerizer@docker1:~/zookeeper$ docker images -a
REPOSITORY TAG IMAGE ID CREATED SIZE
<none> <none> 46371a3fcd90 12 hours ago 783MB
zookeeper latest e85300ce33a1 12 hours ago 783MB
<none> <none> 5dc40a99a229 12 hours ago 783MB
<none> <none> cf203e8e381d 12 hours ago 783MB
<none> <none> 662536a7dd7c 12 hours ago 740MB
<none> <none> fb43b0c06cb3 12 hours ago 783MB
servery latest 0226f44159c2 2 days ago 51.8MB
<none> <none> e25dad0578e1 2 days ago 51.8MB
consul latest d686c08d0dc8 3 days ago 51.8MB
ubuntu latest 747cb2d60bbe 2 weeks ago 122MB
openjdk latest 74c95c985a85 2 weeks ago 740MB
并尝试使用以下命令删除:
dockerizer@docker1:~/zookeeper$ docker rmi $(docker images -f "dangling=true" -q)
"docker rmi" requires at least 1 argument.
See 'docker rmi --help'.
Usage: docker rmi [OPTIONS] IMAGE [IMAGE...]
Remove one or more images
我做错了什么?
这意味着您没有任何悬空的图像。
看到带有 tag none 的图像并不意味着它悬而未决,正如我在"Docker 删除<none>
TAG 映像"中所述
拉取签名映像后,"docker 映像"输出中有一个"额外"条目(带标签)。
这使得rmi
图像变得困难(您必须强制它,否则首先删除正确标记的条目,或通过摘要删除。
docker images --digests=true