Docker Running containers Run a container interactively


Example

To run a container interactively, pass in the -it options:

$ docker run -it ubuntu:14.04 bash
root@8ef2356d919a:/# echo hi
hi
root@8ef2356d919a:/#

-i keeps STDIN open, while -t allocates a pseudo-TTY.