sudo docker images显示所有镜像

1
2
3
4
5
6
7
8
[root@szl ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
tomcat02 latest e13c4d57f126 About an hour ago 669MB
portainer/portainer latest 580c0e4e98b0 6 days ago 79.1MB
tomcat latest 08efef7ca980 11 days ago 667MB
redis latest a617c1c92774 11 days ago 105MB
nginx latest 6084105296a9 12 days ago 133MB
centos latest 300e315adb2f 3 months ago 209MB

删除tomcat镜像,用sudo docker rmi ID 的命令删除时,会出现以下错误:

1
Error response from daemon: conflict: unable to delete 08efef7ca980 (cannot be forced) - image has dependent child images

用以下方法删除成功了

1
2
3
4
5
6
7
8
9
10
[root@szl ~]# docker rmi -f tomcat:latest
Untagged: tomcat:latest
Untagged: tomcat@sha256:cbbf9c0368fbb556967af803a9abe675336a880da41200e9ffb27854bd225c39
[root@szl ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
tomcat02 latest e13c4d57f126 About an hour ago 669MB
portainer/portainer latest 580c0e4e98b0 6 days ago 79.1MB
redis latest a617c1c92774 11 days ago 105MB
nginx latest 6084105296a9 12 days ago 133MB
centos latest 300e315adb2f 3 months ago 209MB