docker rm时提示device or resource busy问题解决

1、现象复现,提示device or resource busy

docker rm -f recom-engine-service
Error response from daemon: driver “overlay2” failed to remove root filesystem for 68222175a2ec896c9a084c5fb87966588cf2ba644e6f8b6f326373fea022d153: remove /data0/docker/overlay2/ce44e5ab1eb91fe52acb87c8e37c140d4240be01d2d4afd12b22442cb86f761b/merged: device or resource busy

2、查找占用目录的进程

grep ce44e5ab1eb91fe52acb87c8e37c140d4240be01d2d4afd12b22442cb86f761b /proc/*/mounts
/proc/189695/mounts:overlay /data0/docker/overlay2/ce44e5ab1eb91fe52acb87c8e37c140d4240be01d2d4afd12b22442cb86f761b/merged overlay rw,relatime,lowerdir=/data0/docker/overlay2/l/F4BQHNVPHGRKWXFRUIHXUMAHZ2:/data0/docker/overlay2/l/POBMGHFBIQXNBM5RUMGRM4S3FH:/data0/docker/overlay2/l/SK2CEBQ4SR2X6UTQDAO6C75RPM:/data0/docker/overlay2/l/QGUGY27GDXCFSPKOSBCOTVAX57:/data0/docker/overlay2/l/GHT67GREWEXGEHUMKXAGEZKONI:/data0/docker/overlay2/l/TKNFNNTVIITCWH7B2TR326OX6N:/data0/docker/overlay2/l/QQ4MIFW35TPBOIVJBKFM5QHUXM:/data0/docker/overlay2/l/APX5ZKNHIOGTAI24C5PBSALHE3:/data0/docker/overlay2/l/BDD7JOCD5YT4OWOEFMNU6URS7A:/data0/docker/overlay2/l/3ZKBAWZ3IW6QSKI4AVSBOPHHSH:/data0/docker/overlay2/l/EYIQC7BRCXET4RFFZCPQH6VN4J:/data0/docker/overlay2/l/HWIZIHJLNPPGJBSZUUV4KJYQD2:/data0/docker/overlay2/l/EAUEDS4QJ5MZOJBYLKLBPPF7MF:/data0/docker/overlay2/l/FYIXAIYRXQEYRMEARBKTXVCI5D:/data0/docker/overlay2/l/YA7M4B2FAVCSD3PRA7XIBWPUHW:/data0/docker/overlay2/l/Q4YBVOMU2RRT5HDA7HBIIDHM2F:/data0/docker/overlay2/l/5UWTJ3WEV7RLCNYG7KWW3G6N4Y:/data0/docker/overlay2/l/5VKRO2YX4XOOAA5DUZJEYB2DUN:/data0/docker/overlay2/l/D7RO2VF73BMT6SHOINS6ZUJF7I:/data0/docker/overlay2/l/ZEAGD6JWMEXCFEBWASW3NOVJKF:/data0/docker/overlay2/l/XCQBF6HB3NCZSGWAKEBBPTQWZE:/data0/docker/overlay2/l/HQR2BEU6HMCWJ7O5C4QYKZE2C2:/data0/docker/overlay2/l/3J5ZAYVPGR6HRCJFJQHNCYLBAX:/data0/docker/overlay2/l/Q3LUROBZNZ7ZIIO5ETKPCUWFPZ,upperdir=/data0/docker/overlay2/ce44e5ab1eb91fe52acb87c8e37c140d4240be01d2d4afd12b22442cb86f761b/diff,workdir=/data0/docker/overlay2/ce44e5ab1eb91fe52acb87c8e37c140d4240be01d2d4afd12b22442cb86f761b/work 0 0
/proc/189697/mounts:overlay /data0/docker/overlay2/ce44e5ab1eb91fe52acb87c8e37c140d4240be01d2d4afd12b22442cb86f761b/merged overlay rw,relatime,lowerdir=/data0/docker/overlay2/l/F4BQHNVPHGRKWXFRUIHXUMAHZ2:/data0/docker/overlay2/l/POBMGHFBIQXNBM5RUMGRM4S3FH:/data0/docker/overlay2/l/SK2CEBQ4SR2X6UTQDAO6C75RPM:/data0/docker/overlay2/l/QGUGY27GDXCFSPKOSBCOTVAX57:/data0/docker/overlay2/l/GHT67GREWEXGEHUMKXAGEZKONI:/data0/docker/overlay2/l/TKNFNNTVIITCWH7B2TR326OX6N:/data0/docker/overlay2/l/QQ4MIFW35TPBOIVJBKFM5QHUXM:/data0/docker/overlay2/l/APX5ZKNHIOGTAI24C5PBSALHE3:/data0/docker/overlay2/l/BDD7JOCD5YT4OWOEFMNU6URS7A:/data0/docker/overlay2/l/3ZKBAWZ3IW6QSKI4AVSBOPHHSH:/data0/docker/overlay2/l/EYIQC7BRCXET4RFFZCPQH6VN4J:/data0/docker/overlay2/l/HWIZIHJLNPPGJBSZUUV4KJYQD2:/data0/docker/overlay2/l/EAUEDS4QJ5MZOJBYLKLBPPF7MF:/data0/docker/overlay2/l/FYIXAIYRXQEYRMEARBKTXVCI5D:/data0/docker/overlay2/l/YA7M4B2FAVCSD3PRA7XIBWPUHW:/data0/docker/overlay2/l/Q4YBVOMU2RRT5HDA7HBIIDHM2F:/data0/docker/overlay2/l/5UWTJ3WEV7RLCNYG7KWW3G6N4Y:/data0/docker/overlay2/l/5VKRO2YX4XOOAA5DUZJEYB2DUN:/data0/docker/overlay2/l/D7RO2VF73BMT6SHOINS6ZUJF7I:/data0/docker/overlay2/l/ZEAGD6JWMEXCFEBWASW3NOVJKF:/data0/docker/overlay2/l/XCQBF6HB3NCZSGWAKEBBPTQWZE:/data0/docker/overlay2/l/HQR2BEU6HMCWJ7O5C4QYKZE2C2:/data0/docker/overlay2/l/3J5ZAYVPGR6HRCJFJQHNCYLBAX:/data0/docker/overlay2/l/Q3LUROBZNZ7ZIIO5ETKPCUWFPZ,upperdir=/data0/docker/overlay2/ce44e5ab1eb91fe52acb87c8e37c140d4240be01d2d4afd12b22442cb86f761b/diff,workdir=/data0/docker/overlay2/ce44e5ab1eb91fe52acb87c8e37c140d4240be01d2d4afd12b22442cb86f761b/work 0 0

3、杀掉进程

kill -9 189695

4、继续操作删除,成功

docker rm -f recom-engine-service
recom-engine-service

参考链接

https://qiita.com/domino-jiang/items/d1cac56e68fba67893e3

你可能感兴趣的:(开发经验分享)