Docker进入容器报:exec failed: unable to start container process: exec: “/bin/bash“ 解决

场景:
执行进入 docker 容器的命令,报如下错误:

OCI runtime exec failed: exec failed: unable to start container process: exec: "/bin/bash": stat /bin/bash: no such file or directory: unknown

分析:
制作镜像时使用了精简版,只装了sh命令,未安装bash
例如:
openjdk:8-jdk-alpine

解决:
将 /bin/bash 换成 /bin/sh 执行方式,成功

你可能感兴趣的:(Docker,Podman和K8s,异常和开发经验总结,docker,bash,容器)