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