容器启动失败提示:OCI runtime create failed: container with id exists ... unknown
环境
问题
在执行如下启动命令后docker start <containerID>
出现了一下异常报错
1
2
|
Error response from daemon: OCI runtime create failed: container with id exists: <containerID>: unknown
Error: failed to start containers: <containerID>
|
解决方案
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# 先把dockerd停了
$ systemctl stop docker
# 再把containerd的进程清理一下
$ pkill -9 containerd
# 进入如下目录
$ cd /run/docker/runtime-runc/moby
# 执行ls命令可以查看到类似显示,都是容器ID
$ ls
2901da5462f792296b36ce7e982d8ef66233fce3c78c8c150522893625768e56
c29c0bc9836880aa883d1ac7e50da56656ed9b2c5499831f3610d775997aa5f2
ed4c1c5e03c74b3ce4c41aafbb5f276064d51546f8359ed493b3623a0baaf648
# 通过rm -rf命令删除文件夹
$ rm -rf *
# 启动dockerd
$ systemctl start docker
# 删除后重新执行命令,即可启动容器
$ docker start <containerID>
|