Executing commands inside a Docker container

I created a docker container (debian: jessie) inside fedora 21 vm (works on vmware fusion). the first time i entered vm and run commands it works fine. i log out of the vm and start over and attach to it (run docker -a dev-001) and run a few commands they just hung up. unable to find the root reason why anyone has a clue? I can successfully inject / attach the container, but a simple command like ps just hangs.

any suggestions?

+3


source to share


1 answer


You can execute commands in a running container with docker exec . This allows the command to run even when the container is running in disconnected mode. If you only want to run some commands and then close the container again, you can use docker run -i .



+1


source







All Articles