I did some googling and have had no luck finding a case where I'd run docker run -i some_image
rather than docker run -it some_image
.
If I run docker run -i --name sample some_image bash
, the container runs in the foreground, but I can't interact with it from the shell I'm in. I can't even stop it with CTRL+C. I can, however, pop open another shell and run docker exec -it sample bash
and gain access to the container.
If I run docker run -i -d --name sample some_image bash
, the container immediately exits. I can restart it with docker start sample
and then it stays up, so I can run docker exec -it sample bash
and interact with it again.
However, in all these cases, I ultimately end up using -it
to interact with my containers. In what world would I not need the -t
flag?
Cheers