一. 问题背景
使用docker rmi 镜像ID
无法删除镜像,报错unable to delete 9a9ad4f631f8 (cannot be forced) - image has dependent child images
二. 解决方案
使用docker 镜像名:tag
删除即可,如下:
[root@localhost ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
my_tomcat_image latest 5bb345113169 6 hours ago 652 MB
docker.io/tomcat latest 9a9ad4f631f8 3 days ago 647 MB
[root@localhost ~]# docker rmi docker.io/tomcat:latest
Untagged: docker.io/tomcat:latest
Untagged: docker.io/tomcat@sha256:acf4e40b918af485753d4e6d219b04efedccc99a821526b5dda91a467008a659
[root@localhost ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
my_tomcat_image latest 5bb345113169 6 hours ago 652 MB