docker的虚悬镜像是什么?

虚悬镜像是什么?仓库名、标签都是的镜像,俗称:dangling image。

我们使用Dockerfile写一个:

1:编写

from ubuntu
CMD echo 'action is success'

2:构建

docker build .

注意没有 -t

产生原因

1:构建时候因为编写错误导致
2:删除的时候

对于这样的虚悬镜像一定要删除。

查看虚悬镜像命令

docker images ls -f dangling=true

命令结果:


这种虚悬镜像已经失去了存在价值,可以删除。
删除虚悬镜像命令:

docker image prune

猜你喜欢

转载自blog.csdn.net/yaxuan88521/article/details/128740402