docker rmi删除不掉镜像的解决方法

我的个人网站:
http://riun.xyz


docker删除不了镜像:

docker rmi 45c94aceead5
Error response from daemon: conflict: unable to delete 45c94aceead5 (must be forced) - image is being used by stopped container 55881c13e4e4

说明docker容器正在启动,不能删除,所以要先停掉容器,而停掉容器不是简单的stop或者kill,要做如下步骤:

先暂停正在运行中的容器:docker stop 容器ID
再清除掉容器使用的网络: docker network disconnect --force bridge 容器ID
再强制删除容器:docker rm -f 容器ID

> docker network disconnect --force bridge 55881c13e4e4
> docker rm -f 55881c13e4e4
> 55881c13e4e4

这时,容器已经被删除掉了,可以删除镜像了:docker rmi 镜像ID

docker rmi jboss/drools-workbench-showcase:latest
Untagged: jboss/drools-workbench-showcase:latest
Untagged: jboss/drools-workbench-showcase@sha256:228aa7d7d983bea1eb96df85f9113852d5922f9a407e1fd8c5a996aa1f74d8e7
Deleted: sha256:45c94aceead5a9eb8a47c3f8d1b0996756ea505774f46cfd0bf0d70c46dfc22f
Deleted: sha256:f793d44c28d6906b81afc0f817dd00a81d278375f309731a281f50f3bdec6d7c
Deleted: sha256:9745ecbf1f98eb2a0df5f1075530f584434099782960b33c626d96a64a31f2f1
Deleted: sha256:9c85101f410f0ca8ebc42cb8106c9f2afc1e7fb972d36470b3cc0f2d2d2f87b5
Deleted: sha256:07c6ab7e468c9f72881f585161dc5f463768f5245bf71aefc722619f0851cb6e
Deleted: sha256:266cef054226482086ce04a12abc3098f2411d1a2b487584d825ea610bc170bb
Deleted: sha256:e5661869b21525692f4bfcedd156a1dc491907d21c569408ec5e1827aabf617b
Deleted: sha256:215edc08c97b348703e8230c1519a8b8e0a478f3fed613afa7ddd5fb35252f2a
Deleted: sha256:d2a37f5ce780b04737077e61038818c169ee5995fcca7bc46b02a9736391d40b
Deleted: sha256:bf58095b0150f4ddd25fe0e52e9650d082dff76b46fa7aade3c724209d3811be
Deleted: sha256:dcec415058f324412d6f3dd5286b6908ccd1336a3888a5a985f10d33a31eb3d4
Deleted: sha256:8595ed565a357f3d3239a3dff78c70950fe5f9fe29c9889a41841d891a0611c6
Deleted: sha256:071d8bd765171080d01682844524be57ac9883e53079b6ac66707e192ea25956
  • 4
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值