1.输入查看镜像文件的命令:
$ docker image ls
得到如下结果:
2.删除名为lihui/demo的镜像,输入如下命令:
$ docker rmi 9fa504a6066a
报错,报错信息如下所示:
观察发现9fa504a6066a这个镜像id指向了两个repository,因此无法删除。
3.删除时可以用repository和tag的方式来删除。输入如下命令:
$ docker rmi lihui/demo
结果如下:
4.再次查看镜像,lihui/demo的镜像就已经被删除了。