zl程序教程

您现在的位置是:首页 >  Java

当前栏目

docker的虚悬镜像是什么?

2023-02-18 16:40:54 时间

虚悬镜像是什么?

答:仓库名、标签都是<none>的镜像,俗称: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