OCI runtime exec failed: exec failed: unable to start container process: exec: “/bin/bash”: stat …

阿里云教程7小时前发布
1 0 0

在执行docker命令时:docker exec -it container_id /bin/bash

提示错误信息:

OCI runtime exec failed: exec failed: unable to start container process: exec: “bash”: executable file not found in $PATH: unknown

OCI runtime exec failed: exec failed: unable to start container process: exec: "/bin/bash": stat ...

docker exec -it dc4863b62565 bash 的参数含义
-i:(in) 保持STDIN(标准输入)打开,即使没有附加(attach)容器。 -t:(terminal) 分配一个伪终端或终端窗口,以便用户可以与容器进行交互。

docker exec -it container_id 命令: 表明进入容器container_id;
bash: 表明在容器内部去找 bash命令, 但是没有找到名为bash的可执行文件。由于容器的基础镜像中并没有包含bash shell。

如果你使用的是一个阉割版的linux镜像,vim默认使用的是vi(Alpine Shell),而没有vim。类似的, 在这种情况下,你应该使用sh来取代bash。

以下是进入容器后,使用sh的命令:

docker exec -it container_id sh

OCI runtime exec failed: exec failed: unable to start container process: exec: "/bin/bash": stat ...

© 版权声明

相关文章

暂无评论

none
暂无评论...