Hello Friends
If is executed the following command
docker run --name ubuntu-it -it ubuntu
The container named ubuntu-it
, based on the ubuntu
image, is created, run, is offered a tty
and finally remains running. It can be stopped with the exit
command. Here the importance about the it
option to have a shell available for human interaction. It to have available the features about the STDIN
and STDOUT/STDERR
streams within the current running container through the shell within the tty
.
For experimental purposes, if is executed the following commands
docker run --name ubuntu-a ubuntu ls
docker run --name ubuntu-b ubuntu date
The containers named ubuntu-a
and ubuntu-b
, based on the ubuntu
image, are created, run, are listed/displayed the execution of the ls
and date
commands and finally the containers are stopped.
The ls
and date
commands are executed within the running containers prior to be stopped.
Question
If the it
option was not used for each docker run
command.
- Why in the hostâs
tty
is possible see the listed/displayed data of thels
anddate
commands?
Observation: I have this consult because when I use the docker start
command, to see the displayed data of the ls/date
command according the case is mandatory use the a
option, and if I use the ai
option it is same as to use the it
option of the docker run
command from the beginning