来自守护程序的错误响应:OCI运行时创建失败:container_linux.go:349:启动容器进程导致“ exec:\” / bin / bash \”

时间:2020-11-10 11:57:02

标签: bash docker

当我尝试在Ubuntu 20.04上使用docker运行容器时遇到麻烦。

命令:

sudo docker start a3d1db2f0efb

a3d1db2f0efb是我的泊坞窗中的容器ID(如下所示)。

CONTAINER ID        IMAGE                COMMAND             CREATED             STATUS                   PORTS               NAMES
e78c6b541d10        pcl-ubuntu20.04-v1   "-sh"               6 hours ago         Created                                      crazy_goodall
a3d1db2f0efb        pcl-ubuntu20.04-v1   "/bin/bash"         6 hours ago         Created                                      heuristic_hermann
bd04e7474a09        hello-world          "/hello"            7 hours ago         Exited (0) 7 hours ago                       awesome_antonelli
35f27571e9f8        hello-world          "/hello"            8 hours ago         Exited (0) 8 hours ago                       focused_lehmann

错误:

Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"/bin/bash\": stat /bin/bash: no such file or directory": unknown
Error: failed to start containers: a3d1db2f0efb

docker的版本为19.03.13。

如果有人知道如何解决问题,请回复我。非常感谢。

如果您需要更多信息,请告诉我。

1 个答案:

答案 0 :(得分:2)

该错误表明用于运行此容器的映像文件系统上不存在/bin/bash。某些图像(例如Alpine)仅包含/bin/sh而不是完整的bash shell。其他图像完全不带任何外壳。根据您要运行的映像,您需要调整要执行的命令。