Error response from daemon: conflict: unable to delete。。。

[报错](Error response from daemon: conflict: unable to delete 13f1d974653f (cannot be forced) - image has dependent child images)

报错的意思是需要先删除容器,再删除镜像

  • 查看所有镜像
[root@docker-1 ~]# docker images
REPOSITORY    TAG       IMAGE ID       CREATED             SIZE
centos        latest    252b7413377f   About an hour ago   210MB
nginx         latest    4cdc5dd7eaad   12 days ago         133MB
hello-world   latest    d1165f221234   4 months ago        13.3kB
centos        <none>    300e315adb2f   7 months ago        209MB

删除最后一个,但是删除报错

  • 删除镜像报错
docker rmi -f 13f1d974653f
Error response from daemon: conflict: unable to delete 13f1d974653f (cannot be forced) - image has dependent child images
  • 查看容器,我已经将所有的容器都删除了,如下结果
[root@docker-1 ~]# docker ps -a
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES
  • 继续删除镜像
[root@docker-1 ~]# docker rmi 300e315adb2f
Error response from daemon: conflict: unable to delete 300e315adb2f (cannot be forced) - image has dependent child images

还是会报错,我又换了一个方法

  • 删除镜像,并加上版本
[root@docker-1 ~]# docker rmi centos:<none>
-bash: 未预期的符号 `newline' 附近有语法错误

我发现,版本出现none后无法删除

接下来重要的

  • 将需要删除的镜像的版本号进行重命名
[root@docker-1 ~]# docker tag 300e315adb2f centos:v1
  • 然后运行删除,成功了
[root@docker-1 ~]# docker images
REPOSITORY    TAG       IMAGE ID       CREATED             SIZE
centos        latest    252b7413377f   About an hour ago   210MB
nginx         latest    4cdc5dd7eaad   12 days ago         133MB
hello-world   latest    d1165f221234   4 months ago        13.3kB
centos        v1        300e315adb2f   7 months ago        209MB
[root@docker-1 ~]# docker rmi centos:v1
Untagged: centos:v1
Untagged: centos@sha256:5528e8b1b1719d34604c87e11dcd1c0a20bedf46e83b5632cdeac91b8c04efc1

以上是我遇到问题,并解决的方法,希望可以帮到你们。

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值