我正在运行容器hypriot / rpi-busyBox-httpd
我正在尝试ssh到docker容器:但是它给出了错误:
pi@raspberrypi:~ $docker exec -it cc55da85b915 bash
rpc error: code = 2 desc = oci runtime error: exec Failed: container_linux.go:247: starting container process caused "exec: \"bash\": executable file not found in $PATH"
pi@raspberrypi:~ $docker exec -it cc55da85b915 sh
rpc error: code = 2 desc = oci runtime error: exec Failed: container_linux.go:247: starting container process caused "exec: \"sh\": executable file not found in $PATH"
我马上做了什么?
最佳答案
它可能是你的图像没有安装二进制/ bin / bash(如前所述),我有同样的问题,我能够使用/ bin / sh进入容器
原文链接:https://www.f2er.com/docker/436789.htmldocker exec -ti cc55da85b915 /bin/sh
另一种解决方法是直接执行命令而无需访问任何shell.
docker exec -ti cc55da85b915 ls /etc