Is it difference between this commands?
docker container run -d --name moby-counter --network moby-counter -p 8080:80 russmckendrick/moby-counter docker run -itd --name moby-counter --network moby-counter -p 9090:80 russmckendrick/moby-counter
In addition then why in second command uses -i(Interactive) and -t(TTY)?
Advertisement
Answer
docker container run
is equivalent to docker run
, as well as nearly all docker container
commands can be found without container
subset.
About -it
. t
creates console (tty
), and i
forwards your input to docker. That means you can use -t
when you just need to observe the output, but you need both when container expects some input from you.