在删除docker容器的时候报错,说设备正忙
Error response from daemon: Driver overlay2 failed to remove root filesystem 21852249cce97a1ad5b631ca9f52c81b862d741591e0d337011a28d31992b64f: remove /var/lib/docker/overlay2/38735aa65b119c0c9cc620e07329279bcc20e9482feaaf81d85982c5ccc4543c/merged: device or resource busy
通过 docker ps -a 查看有两个状态的dead的容器
解决方法:
1、查看所有挂载的设备
grep docker /proc/*/mountinfo
1
2、截取设备的进程id
grep docker /proc/*/mountinfo | grep 38735aa65b119c0c9cc620e07329279bcc20e9482feaaf81d85982c5ccc4543 | awk -F’:’ ‘{print $1}’ | awk -F’/’ ‘{print $3}’
3、将这些进程杀掉即可