1、查看镜像 docker images
[root@demo1 ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
docker.io/googlecontainer/pause-amd64 3.0 99e59f495ffa 3 years ago 747 kB
gcr.io/google_containers/pause-amd64 3.0 99e59f495ffa 3 years ago 747 kB
2、删除镜像,会报错
[root@demo1 ~]# docker rmi 99e59f495ffa
Error response from daemon: conflict: unable to delete 99e59f495ffa (must be forced) - image is referenced in multiple repositories
3、仔细观察,发现f8ab12e03d53这个镜像id指向了两个repository,因此无法删除
4、删除时可以用repository和tag的方式来删除
[root@demo1 ~]# docker rmi docker.io/googlecontainer/pause-amd64:3.0
Untagged: docker.io/googlecontainer/pause-amd64:3.0
Untagged: docker.io/googlecontainer/pause-amd64@sha256:eb7d5e4b850dae2cd24897b8a74336459f6eb321e2538d33902f9919eb4f4c98
[root@demo1 ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
gcr.io/google_containers/pause-amd64 3.0 99e59f495ffa 3 years ago 747 kB
[root@demo1 ~]# docker rmi gcr.io/google_containers/pause-amd64:3.0
Untagged: gcr.io/google_containers/pause-amd64:3.0
Deleted: sha256:99e59f495ffaa222bfeb67580213e8c28c1e885f1d245ab2bbe3b1b1ec3bd0b2
Deleted: sha256:666604249ff52593858b7716232097daa6d721b7b4825aac8bf8a3f45dfba1ce
Deleted: sha256:7897c392c5f451552cd2eb20fdeadd1d557c6be8a3cd20d0355fb45c1f151738
Deleted: sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef
[root@demo1 ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE