简体   繁体   English

在Docker Container中运行命令

[英]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.

相关问题 使用 bash,是否可以在 docker 容器内输入命令 - with bash, is it possible to enter commands inside a docker container 在Docker容器中运行时的结果不同 - Different results when running inside a docker container 无法在Jenkins Execute Shell中的Docker容器内执行命令 - Unable to execute commands inside docker container in Jenkins Execute Shell 如何在 Jenkins 的 docker 容器内执行命令 - How to execute commands inside docker container from Jenkins 在docker容器中运行的Python程序依赖于'uname -r' - Python program running inside docker container relies upon 'uname -r' 如何连接在 Docker 容器内运行的 MSSQL 服务器? - How to connect on MSSQL server running inside a Docker container? 是否可以将字符串发送到docker容器内的正在运行的进程中? - Is it possible to send string into running process inside docker container? 在 Docker 容器内运行的进程的主机中的 PID 是什么? - What is the PID in the host, of a process running inside a Docker container? 运行中的 Docker 容器内不允许执行 chmod 0777 操作 - Operation chmod 0777 not permitted inside a running Docker container 为什么在docker容器内运行top只显示容器内的进程? - Why does running top inside docker container only show processes inside the container?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM