Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.7k views
in Technique[技术] by (71.8m points)

docker - 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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...