简体   繁体   中英

OCI runtime create failed: container_linux.go:348: starting container process caused “exec: \”-it\“: executable file not found in $PATH”:unknown

I am not able to run the container from the image in docker for windows version 18.03.1-ce. I am trying to run the command:

  docker run ubuntu -it /bin/bash

Somehow it is not able to find the path of the /bin/bash . I don't know why this is happening.

The docker command line is order sensitive. The order of args goes:

docker ${args_to_docker} run ${args_to_run} image_ref ${cmd_in_container}

Everything after ubuntu in your command goes to the command trying to be run. In your case -it . What you want instead is to pass -it to "run" so that you get interactive input with a tty terminal associated.

docker run -it ubuntu /bin/bash

This error encountered when trying to run command that is not in docker container /usr/bin or /usr/local/bin . If you have let's say rar installed in the docker then you can run rar command via docker exec, if you don't, will get the error above.

Also don't use -t only use -i like below:

docker exec -i <container_name> <command>
docker exec -i <container_name> rar

在尝试任何事情之前,请检查您的 docker 版本,更新,然后重试。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

Related Question OCI runtime create failed: container_linux.go:349: starting container process caused “exec: \”xxxx\“: executable file not found in $PATH”: unknown Docker: OCI runtime create failed: container_linux.go:349: starting container process caused “exec: \”java\“: executable file not found in $PATH” OCI runtime create failed: container_linux.go:349: starting container process caused “exec: \”r-base\“: executable file not found in $PATH”: unknown Cannot restart container OCI runtime create failed: container_linux.go:367: starting container process caused: exec:: permission denied: unknown CannotStartContainerError: API error (400): OCI runtime create failed: container_linux.go:348: starting container process caused Dockerfile - ERROR: for php Cannot start service php: OCI runtime create failed: container_linux.go:348: starting container process caused "exec OCI runtime exec failed: exec failed: container_linux.go:349: starting container process caused "exec: OCI runtime exec failed: exec failed: container_linux.go:344: starting container process caused \"exec OCI runtime exec failed: exec failed: container_linux.go:380: starting container process caused: exec: <PATH>: container_linux.go:349: starting container process caused exec: flask: executable file not found in $PATH
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM