docker删除dead容器

每次都要去重新搜好烦, 写个博客记下来吧

6f1a6a257c60        registry:latest                               "/entrypoint.sh /e..."   6 months ago        Dead                                                                                                                     registry

有毒, 错误信息已经找不回来了, 下次遇到再说吧

就是删的时候提示 什么无法移除挂载卷什么的

通过容器id查找所在挂载卷的进程

grep 6f1a6a257c6065a1f4c6485b62bf021a9ab207861fb8794d623b49a84763352c /proc/*/mountinfo

然后干掉对应的进程就OK了

[root@mcenter-developer home]# grep 6f1a6a257c6065a1f4c6485b62bf021a9ab207861fb8794d623b49a84763352c /proc/*/mountinfo
/proc/14967/mountinfo:330 268 0:38 / /var/lib/docker/containers/6f1a6a257c6065a1f4c6485b62bf021a9ab207861fb8794d623b49a84763352c/shm rw,nosuid,nodev,noexec,relatime shared:141 - tmpfs shm rw,seclabel,size=65536k
/proc/15140/mountinfo:330 268 0:38 / /var/lib/docker/containers/6f1a6a257c6065a1f4c6485b62bf021a9ab207861fb8794d623b49a84763352c/shm rw,nosuid,nodev,noexec,relatime shared:141 - tmpfs shm rw,seclabel,size=65536k
grep: /proc/30408/mountinfo: 无效的参数
/proc/7515/mountinfo:771 770 0:38 / /var/lib/docker/containers/6f1a6a257c6065a1f4c6485b62bf021a9ab207861fb8794d623b49a84763352c/shm rw,nosuid,nodev,noexec,relatime shared:335 - tmpfs shm rw,seclabel,size=65536k
/proc/7517/mountinfo:771 770 0:38 / /var/lib/docker/containers/6f1a6a257c6065a1f4c6485b62bf021a9ab207861fb8794d623b49a84763352c/shm rw,nosuid,nodev,noexec,relatime shared:335 - tmpfs shm rw,seclabel,size=65536k
/proc/7518/mountinfo:771 770 0:38 / /var/lib/docker/containers/6f1a6a257c6065a1f4c6485b62bf021a9ab207861fb8794d623b49a84763352c/shm rw,nosuid,nodev,noexec,relatime shared:335 - tmpfs shm rw,seclabel,size=65536k
/proc/7519/mountinfo:771 770 0:38 / /var/lib/docker/containers/6f1a6a257c6065a1f4c6485b62bf021a9ab207861fb8794d623b49a84763352c/shm rw,nosuid,nodev,noexec,relatime shared:335 - tmpfs shm rw,seclabel,size=65536k
/proc/7520/mountinfo:771 770 0:38 / /var/lib/docker/containers/6f1a6a257c6065a1f4c6485b62bf021a9ab207861fb8794d623b49a84763352c/shm rw,nosuid,nodev,noexec,relatime shared:335 - tmpfs shm rw,seclabel,size=65536k
/proc/7521/mountinfo:771 770 0:38 / /var/lib/docker/containers/6f1a6a257c6065a1f4c6485b62bf021a9ab207861fb8794d623b49a84763352c/shm rw,nosuid,nodev,noexec,relatime shared:335 - tmpfs shm rw,seclabel,size=65536k

大概就是这样

 kill -9 7515
 kill -9 14967

等进程都杀掉了, 就可以转头把容器杀掉了

6f1a6a257c60        registry:latest                               "/entrypoint.sh /e..."   6 months ago        Dead                                                                                                                     registry
[root@mcenter-developer home]# docker rm 6f1
6f1

你可能感兴趣的:(docker)