stat /bin/bash: no such file or directory“: unknown.

  我们习惯的使用下面命令进入容器:

docker run -it --name container5 busybox /bin/bash

  但是今天遇到报错如下:

[root@moapp-0003 ~]# docker exec -it c713b93718e0 /bin/bash
OCI runtime exec failed: exec failed: container_linux.go:380: starting container process caused: 
exec: "/bin/bash": stat /bin/bash: no such file or directory: unknown

  核心信息就是:exec: "/bin/bash": stat /bin/bash: no such file or directory: unknown

  解决方式:可以将上面的命令修改为

# 将/bin/bash修改为/bin/sh
docker run -it --name container5 busybox /bin/sh
[root@moapp-0003 ~]# docker exec -it c713b93718e0 /bin/sh
/data #
/data #

# 改成 /bin/sh 就可以了

 

上一篇:Linux centos7 find 命令


下一篇:回溯法代码模板