I need pseudo-tty and keep stdin open even if I am not attached to the container.
In docker I can use this: docker run -i -t ubuntu /bin/bash
If I use this in fig:
test:
image: ubuntu:14.04
command: /bin/bash
Then I can't connect to the running docker container. Any idea?
With docker 1.3, there is a new command docker exec
. This allows you to enter a running docker:
docker exec -it <container-id> bash
For older version of docker I would use the nsenter, a tool to connect to a running docker container.