OCI运行时创建失败:container_linux.go:348:启动容器进程导致“ exec:\ -it\”:在$ PATH中找不到可执行文件”:未知
问题描述:
对于Windows版本18.03.1-ce,我无法从Docker中的映像运行容器。我正在尝试运行命令:
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
以某种方式无法找到 / bin / bash
的路径。我不知道为什么会这样。
Somehow it is not able to find the path of the /bin/bash
. I don't know why this is happening.
答
docker命令行是顺序敏感的。 args的顺序为:
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}
命令中 ubuntu
之后的所有内容都转到试图跑。就您而言,-它
。相反,您想要的是传递 -it
进行运行,以便获得与tty终端相关联的交互式输入。
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