详细信息
[root@centOS7 ~]# docker exec -it 3cae7605916d /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
老规矩:先上答案 把脚本类型 /bin/bash,尝试换为 /bin/sh 试一下,如果你想对两种shell的区别有深入了解,点击这里。
注意:
如果你在Dockerfile中引用了自定义脚本,比如:entrypoint: ./entrypoint.sh,如果没有单独给该脚本通过chmod +x ./entrypoint.sh 添加执行权限,也可能会报这个错误。
前言
在docker学习中,大部分容器进入的脚本都是/bin/bash,比如tomcat,所以不假思索的