Error response from daemon: conflict: unable to remove repository reference xxx

Error:

想删除centos镜像,因为docker images 里面有两个centos,所以删除其中一个。

[root@jdcloud3 ~]# docker rmi centos:latest
Error response from daemon: conflict: unable to remove repository 
reference "centos:latest" (must force) 
- container b78aedf3926a is using its referenced image 0f3e07c0138f

Solution:

出现这个问题是因为多个容器占用同一个镜像的问题,请重复删除即可。

centos 这个镜像删不了 是它在多个容器里在跑  一 一 remove掉

然后回来再去删除容器依赖的原镜像

[root@jdcloud3 ~]# docker rm b78aedf3926a
b78aedf3926a
[root@jdcloud3 ~]# docker rmi centos:latest
Untagged: centos:latest
Untagged: centos@sha256:f94c1d992c193b3dc09e297ffd54d8a4f1dc946c37cbeceb26d35ce1647f88d9
Deleted: sha256:0f3e07c0138fbe05abcb7a9cc7d63d9bd4c980c3f61fea5efa32e7c4217ef4da
Deleted: sha256:9e607bb861a7d58bece26dd2c02874beedd6a097c1b6eca5255d5eb0d2236983
[root@jdcloud3 ~]# docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
zookeeper           latest              611ffeaf5959        2 days ago          224MB
redis               latest              dcf9ec9265e0        11 days ago         98.2MB
python              latest              0a3a95c81a2b        12 days ago         932MB
mysql               latest              d435eee2caa5        12 days ago         456MB
<none>              <none>              e9ee535ba1b1        2 weeks ago         491MB
docker              latest              52f7c6fb16b9        2 weeks ago         216MB
centos              centos7             5e35e350aded        3 weeks ago         203MB
openjdk             8-jdk-alpine        a3562aa0b991        6 months ago        105MB
hello-world         latest              fce289e99eb9        11 months ago       1.84kB
[root@jdcloud3 ~]# 

PS:

镜像和容器就像是面向对象程序设计中的类和实例一样,镜像是静态的定义,容器是镜像运行时的实体。

你想删除某个镜像但是有多个容器依赖于这个镜像在running。

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值