docker dead 删除失败

昨天搭建环境的时候,需要删除旧的docker容器和镜像,发现了一个删除不掉的容器,然后开始了百度之路。(看博文前先重启docker试试,如果不行在继续看希望能帮助到你
发现了各种原因找了好几种解决方法
1、直接找出进程号,然后干掉进程具体在这里插入代码片执行(节选自简书原文连接

[root@instance-ww74cmok-2 libcontainerd]# docker rm proxy
Error response from daemon: Driver overlay2 failed to remove root filesystem 784e737579056e2a2e865b3fcd4ccd32dd8e236005e08f7512ad06441ea48d6d: remove /mnt/docker/data/overlay2/be672677265b39ed177a79f834baf63f4746faf5f73cba3b71c79ddaa024d0a0/merged: device or resource busy

[root@instance-ww74cmok-2 libcontainerd]# grep docker /proc/*/mountinfo|grep be672677265b39ed177a79f834baf63f4746faf5f
/proc/41386/mountinfo:266 260 0:56 / /mnt/docker/data/overlay2/be672677265b39ed177a79f834baf63f4746faf5f73cba3b71c79ddaa024d0a0/merged rw,relatime shared:146 - overlay overlay rw,lowerdir=/mnt/docker/data/overlay2/l/7KZQP373LMR2YNDLGVCOAO6HPD:/mnt/docker/data/overlay2/l/PZMWE2VDX4O2BCHEI2TUZUIPUP:/mnt/docker/data/overlay2/l/3GN3WH2OMZE4VEB667HEX7GIF4:/mnt/docker/data/overlay2/l/JM4S4P76O7CQLRU6JHHGZIAJJR:/mnt/docker/data/overlay2/l/IT54IDZSZAS4SNWJYKGSUITWTO:/mnt/docker/data/overlay2/l/ECULN7DI6S565DMEIVIX43HYJL:/mnt/docker/data/overlay2/l/R6TREWCFOXRYT3ZWIKITG3PEFJ:/mnt/docker/data/overlay2/l/QCCUZ66IANXVWGUUPBU5I4ZFUM:/mnt/docker/data/overlay2/l/ZHH23PQ4HYSHQES3LSLYJQBULT:/mnt/docker/data/overlay2/l/FUPO2U3IUKC7YRB6RZPANPNYGN:/mnt/docker/data/overlay2/l/ZVQEZSR4T4OSRNATTXFEK6WTUC:/mnt/docker/data/overlay2/l/7UIBFOQG7WQR7PDUG2P6T7ED6H:/mnt/docker/data/overlay2/l/Y2LOEGAG3LQ46G6LEMB5MNF5OD:/mnt/docker/data/overlay2/l/UEPEBRKPRX6IRK6FFSBWSRQQNA:/mnt/docker/data/overlay2/l/KWDGJS5UF3SIG3EHH3DYDI4JXE:/mnt/docker/data/overlay2/l/ARQ52BAAQ3X2JOLEG3AQK3H76B:/mnt/docker/data/overlay2/l/2RPDDZH2EPCPKNLGQYLXYFKQHQ,upperdir=/mnt/docker/data/overlay2/be672677265b39ed177a79f834baf63f4746faf5f73cba3b71c79ddaa024d0a0/diff,workdir=/mnt/docker/data/overlay2/be672677265b39ed177a79f834baf63f4746faf5f73cba3b71c79ddaa024d0a0/work
/proc/52227/mountinfo:266 260 0:56 / /mnt/docker/data/overlay2/be672677265b39ed177a79f834baf63f4746faf5f73cba3b71c79ddaa024d0a0/merged rw,relatime shared:146 - overlay overlay rw,lowerdir=/mnt/docker/data/overlay2/l/7KZQP373LMR2YNDLGVCOAO6HPD:/mnt/docker/data/overlay2/l/PZMWE2VDX4O2BCHEI2TUZUIPUP:/mnt/docker/data/overlay2/l/3GN3WH2OMZE4VEB667HEX7GIF4:/mnt/docker/data/overlay2/l/JM4S4P76O7CQLRU6JHHGZIAJJR:/mnt/docker/data/overlay2/l/IT54IDZSZAS4SNWJYKGSUITWTO:/mnt/docker/data/overlay2/l/ECULN7DI6S565DMEIVIX43HYJL:/mnt/docker/data/overlay2/l/R6TREWCFOXRYT3ZWIKITG3PEFJ:/mnt/docker/data/overlay2/l/QCCUZ66IANXVWGUUPBU5I4ZFUM:/mnt/docker/data/overlay2/l/ZHH23PQ4HYSHQES3LSLYJQBULT:/mnt/docker/data/overlay2/l/FUPO2U3IUKC7YRB6RZPANPNYGN:/mnt/docker/data/overlay2/l/ZVQEZSR4T4OSRNATTXFEK6WTUC:/mnt/docker/data/overlay2/l/7UIBFOQG7WQR7PDUG2P6T7ED6H:/mnt/docker/data/overlay2/l/Y2LOEGAG3LQ46G6LEMB5MNF5OD:/mnt/docker/data/overlay2/l/UEPEBRKPRX6IRK6FFSBWSRQQNA:/mnt/docker/data/overlay2/l/KWDGJS5UF3SIG3EHH3DYDI4JXE:/mnt/docker/data/overlay2/l/ARQ52BAAQ3X2JOLEG3AQK3H76B:/mnt/docker/data/overlay2/l/2RPDDZH2EPCPKNLGQYLXYFKQHQ,upperdir=/mnt/docker/data/overlay2/be672677265b39ed177a79f834baf63f4746faf5f73cba3b71c79ddaa024d0a0/diff,workdir=/mnt/docker/data/overlay2/be672677265b39ed177a79f834baf63f4746faf5f73cba3b71c79ddaa024d0a0/work
/proc/52228/mountinfo:266 260 0:56 / /mnt/docker/data/overlay2/be672677265b39ed177a79f834baf63f4746faf5f73cba3b71c79ddaa024d0a0/merged rw,relatime shared:146 - overlay overlay rw,lowerdir=/mnt/docker/data/overlay2/l/7KZQP373LMR2YNDLGVCOAO6HPD:/mnt/docker/data/overlay2/l/PZMWE2VDX4O2BCHEI2TUZUIPUP:/mnt/docker/data/overlay2/l/3GN3WH2OMZE4VEB667HEX7GIF4:/mnt/docker/data/overlay2/l/JM4S4P76O7CQLRU6JHHGZIAJJR:/mnt/docker/data/overlay2/l/IT54IDZSZAS4SNWJYKGSUITWTO:/mnt/docker/data/overlay2/l/ECULN7DI6S565DMEIVIX43HYJL:/mnt/docker/data/overlay2/l/R6TREWCFOXRYT3ZWIKITG3PEFJ:/mnt/docker/data/overlay2/l/QCCUZ66IANXVWGUUPBU5I4ZFUM:/mnt/docker/data/overlay2/l/ZHH23PQ4HYSHQES3LSLYJQBULT:/mnt/docker/data/overlay2/l/FUPO2U3IUKC7YRB6RZPANPNYGN:/mnt/docker/data/overlay2/l/ZVQEZSR4T4OSRNATTXFEK6WTUC:/mnt/docker/data/overlay2/l/7UIBFOQG7WQR7PDUG2P6T7ED6H:/mnt/docker/data/overlay2/l/Y2LOEGAG3LQ46G6LEMB5MNF5OD:/mnt/docker/data/overlay2/l/UEPEBRKPRX6IRK6FFSBWSRQQNA:/mnt/docker/data/overlay2/l/KWDGJS5UF3SIG3EHH3DYDI4JXE:/mnt/docker/data/overlay2/l/ARQ52BAAQ3X2JOLEG3AQK3H76B:/mnt/docker/data/overlay2/l/2RPDDZH2EPCPKNLGQYLXYFKQHQ,upperdir=/mnt/docker/data/overlay2/be672677265b39ed177a79f834baf63f4746faf5f73cba3b71c79ddaa024d0a0/diff,workdir=/mnt/docker/data/overlay2/be672677265b39ed177a79f834baf63f4746faf5f73cba3b71c79ddaa024d0a0/work
You have new mail in /var/spool/mail/root
 
[root@instance-ww74cmok-2 libcontainerd]# ^C
[root@instance-ww74cmok-2 libcontainerd]# ^C
[root@instance-ww74cmok-2 libcontainerd]# grep docker /proc/*/mountinfo|grep be672677265b39ed177a79f834baf63f4746faf5f | awk -F ":" '{print $1}' | awk -F "/" '{print $3}'
41386
52227
52228
[root@instance-ww74cmok-2 libcontainerd]# ^C
[root@instance-ww74cmok-2 libcontainerd]# kill -9 41386
[root@instance-ww74cmok-2 libcontainerd]# kill -9 52227
[root@instance-ww74cmok-2 libcontainerd]# kill -9 52228
 
[root@instance-ww74cmok-2 libcontainerd]# docker rm proxy
proxy


[root@instance-ww74cmok-2 libcontainerd]# 说明删除成功!!!!!

2、这个方法我不太懂,文中说的是吞掉这个错误就可以了我也不知道什么意思懂得大佬求解答(摘自简书原文连接

[root@Ieat1 ~]# docker rm -f nginx
Error response from daemon: Driver devicemapper failed to remove root filesystem a838d837988a593de3e997748cc80b1540dd31697f66e93dad275fbeaa5b3278: Device is Busy
[root@Ieat1 ~]# docker ps -a|grep nginx
a838d837988a        nginx                                                   "nginx -g 'daemon ..."   3 weeks ago         Dead 
docker stop nginx 1>/dev/null 2>&1 | exit 0
docker rm -f nginx 1>/dev/null 2>&1 | exit 0
[root@Ieat1 ~]# docker ps -a|grep nginx

很不幸,以上方法没有解决我的问题,因为我查看线程的时候他有太多的线程,我不可能一个一个删除掉,然后我突然想万能的重启大法试一试,然后就解决了,就解决了,,,,,。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值