虚悬镜像
[toc]
提示
前面讲过什么是虚悬镜像·仓库名、标签都是<none>
的镜像,俗称dangling image
Dockerfile写一个
from ubuntu
CMD echo 'action is success'
测试,没什么
root@ubuntu:/myfile/test# docker build .
Sending build context to Docker daemon 2.048kB
Step 1/2 : from ubuntu
---> ba6acccedd29
Step 2/2 : CMD echo 'action is success'
---> Running in 5e5d12d28ce2
Removing intermediate container 5e5d12d28ce2
---> 5c2d858f45c0
Successfully built 5c2d858f45c0
已经出现
查看所有虚悬镜像
root@ubuntu:/myfile/test# docker image ls -f dangling=true
REPOSITORY TAG IMAGE ID CREATED SIZE
<none> <none> 5c2d858f45c0 About a minute ago 72.8MB
<none> <none> 3f26da6b3168 9 minutes ago 231MB
虚悬镜像已经失去存在价值,可以删除
docker image prune