0

This post nicely explains difference between detached (-d) and interactive (-i). The answer says:

-i (interactive) is about whether to keep stdin open (some programs, like bash, use stdin and other programs don't). -d (detached) is about whether the docker run command waits for the process being run to exit. Thus, they are orthogornal and not inherently contradictory. A program like bash exits when stdin in closed, so without -i, it exits immediately.

Assume that I have some command which does not require opened STDIN. Then what is the difference between using -it and not using -it? Is there any difference e.g. in following two commands?

docker run ubuntu tail -f /etc/passwd
docker run -it ubuntu tail -f /etc/passwd

1 Answer 1

1

Refer to the docker run command documentation

--interactive , -i  : Keep STDIN open even if not attached
--tty , -t          : Allocate a pseudo-TTY

I thought that the only difference between executing with -it or not in your case is that will runs Docker interactively and through pseudo-TTY

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.