提示:docker restart XXX Error response from daemon: Cannot restart container XXX: container “XXX”: already exists
- 即使运行systemctl restart docker也不管用,可能部分容器起来
- 使用systemctl stop docker,会把bridge网络的容器启动起来,却不会kill docker???
- 使用docker start xxx,一直报already exists错误。
原因:容器未安全退出
解决方式一:【推荐】
按评论中的沟通方式补充:
docker ps -a|grep $容器名称
ps -ef|grep $上一步的容器id
kill -9 $上一步的容器自身进程id
解决方式二:
什么别管,重启能解决50%的问题:
reboot
解决方式三:
#xxx为容器hash_id
rm -r /var/run/docker/runtime-runc/moby/xxx
参考 :
docker-issue
https://github.com/moby/moby/issues/36145
常见docker问题
https://blog.csdn.net/qq_41958579/article/details/107927140