smhk

Docker: understanding it

It’s common to see docker run -it or docker run -itd, but what do those arguments actually mean?

i is for interactive §

  • Lets you send input to the container through STDIN.
  • Most often -i is used with -t, to create an interactive terminal session.
  • Enable with -i or --interactive (docs).

t is for TTY §

  • Attaches a pseudo-TTY to the container.
  • It is rarely useful to use -t without -i.
  • Enable with -t or --tty (docs).

d is for detach §

  • Starts the container as a background process that doesn’t occupy the terminal window.
  • Enable with -d or --detach (docs).