1、查看镜像 docker images
[root@localhost ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
xuxueli/xxl-job-admin 2.3.0 24cc0d9dcf54 5 days ago 223MB
mysql latest c8562eaf9d81 3 weeks ago 546MB
redis 5 e35748fd6a72 4 weeks ago 98.4MB
192.168.43.119:80/test/busybox latest 754228d7562e 7 weeks ago 1.23MB
busybox_test 1.0.0 754228d7562e 7 weeks ago 1.23MB
docker_test latest 754228d7562e 7 weeks ago 1.23MB
2、删除镜像,会报错
[root@localhost ~]# docker rmi 754228d7562e 754228d7562e 754228d7562e
Error response from daemon: conflict: unable to delete 754228d7562e (must be forced) - image is referenced in multiple repositories
仔细观察,发现754228d7562e这个镜像id指向了两个repository,因此无法删除
3、删除时可以用repository和tag的方式来删除
[root@localhost ~]# docker rmi 192.168.43.119:80/test/busybox:latestUntagged: 192.168.43.119:80/test/busybox:latest
Untagged: 192.168.43.119:80/test/busybox@sha256:5e8c842ceb8843c244a341f42bfb9ac701551d8ce6b23155be21ca2606de6bae
4、再次查看镜像,192.168.43.119:80/test/busybox:latest的就被删除了。
[root@localhost ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
xuxueli/xxl-job-admin 2.3.0 24cc0d9dcf54 5 days ago 223MB
mysql latest c8562eaf9d81 3 weeks ago 546MB
redis 5 e35748fd6a72 4 weeks ago 98.4MB
docker_test latest 754228d7562e 7 weeks ago 1.23MB
busybox_test 1.0.0 754228d7562e 7 weeks ago 1.23MB