[英]Running commands inside Docker Container
I created a docker container (debian:jessie) inside a fedora 21 vm(running on vmware fusion). 我在fedora 21 vm(在vmware fusion上运行)中创建了一个docker容器(debian:jessie)。 first time when i entered vm and ran commands it works fine.
第一次当我输入vm并运行命令时它工作正常。 i exit the vm and start again and attach to it ( docker start -a dev-001) and run few commands they just hung.
我退出虚拟机并重新启动并连接到它(docker start -a dev-001)并运行几个他们刚刚挂起的命令。 not able to find the root cause any one has any clue ?
无法找到任何人有任何线索的根本原因? i am able to successfully enter/attach the container but simple command like ps just gets hung.
我能够成功输入/附加容器,但像ps这样的简单命令就会挂起。
any suggestions ? 有什么建议么 ?
You are able to execute commands in an running container with docker exec . 您可以使用docker exec在正在运行的容器中执行命令。 This allows you to execute command even when the container is started in detached mode.
这使您即使在分离模式下启动容器时也可以执行命令。 If you want to run just some commands and then close the container again you can use docker start -i .
如果您只想运行某些命令,然后再次关闭容器,则可以使用docker start -i 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.