当我使用命令docker ps -a
时,它会列出几个带有存储库<none>
的图像。我假设他们与另一张图片有关,因为时间戳相似。我只是想知道他们的目的是什么?
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
opensuse latest 33ab078b606b 5 days ago 254.6 MB
mattgruter/drone latest ec2ee19cb579 2 weeks ago 312.4 MB
<none> <none> 69d95bd4b1f9 2 weeks ago 312.4 MB
<none> <none> 227d0f1e0dfa 2 weeks ago 312.4 MB
<none> <none> a19dbed68faa 2 weeks ago 312.4 MB
<none> <none> 01ff591e80dc 2 weeks ago 312.4 MB
<none> <none> 89c0c546d2ba 2 weeks ago 312.4 MB
<none> <none> 030d18544ee4 2 weeks ago 279.1 MB
<none> <none> 1aaa2da8e8c2 2 weeks ago 271.6 MB
<none> <none> c7928e43d1b3 2 weeks ago 269.9 MB
<none> <none> 0252973e04f0 2 weeks ago 268.6 MB
<none> <none> 2004ab1a6ca0 2 weeks ago 268.6 MB
<none> <none> c26aae018d13 2 weeks ago 268.6 MB
<none> <none> 5707a16ae741 2 weeks ago 268.6 MB
<none> <none> d959a0f0afef 2 weeks ago 268.6 MB
<none> <none> bd654a62529d 2 weeks ago 268.6 MB
<none> <none> bd52fe5f72a3 2 weeks ago 220.6 MB
<none> <none> cd074038dbb7 2 weeks ago 209.2 MB
<none> <none> 4c12a68b82b3 2 weeks ago 188.3 MB
<none> <none> f272e06028fd 2 weeks ago 188.3 MB
<none> <none> 6d4946999d4f 3 weeks ago 188.3 MB
<none> <none> 9fd3c8c9af32 3 weeks ago 188.3 MB
<none> <none> 435050075b3f 3 weeks ago 188.3 MB
<none> <none> 428b411c28f0 3 weeks ago 188.1 MB
<none> <none> 5b8dd08af89b 10 weeks ago 0 B
答案 0 :(得分:1)
构建映像时,docker会创建临时容器,以便从一个步骤移动到另一个步骤。
但是这些“&lt; none&gt;”图像是别的东西;它们是在使用与已经拉出的存储库/标记相同的存储库/标记构建映像时创建的。它们被称为悬空/未标记图像。
您可以通过以下方式清理它们:
docker rmi $(docker images -f "dangling=true" -q)