I’m trying to understand if the docker run command can always be represented using the separate commands docker pull, docker create, and docker start.
I’ve come up with the following breakdown for different docker run scenarios and would like to know if my representations/interpretations are correct.
Are these combinations accurate for representing the behavior of the docker run command?
If there are any inaccuracies or improvements, please let me know.
docker run my_image:
docker pull my_image #Only if not locally available
docker create --name my_container my_image
docker start -a my_container #Foreground (-a attaches to STDOUT and STDERR), CTRL+C = Context canceled
docker run -it my_image
docker pull my_image #Only if not locally available
docker create -it --name my_container my_image #-it allocates a TTY and keeps STDIN open
docker start -i my_container #Foreground (-i attaches to the container's STDIN, STDOUT, and STDERR), CTRL+C = EXIT
docker run -d my_image
docker pull my_image #Only if not locally available
docker create --name my_container my_image
docker start my_container #Background (no -i/-a given)
docker run -it -d my_image
docker pull my_image #Only if not locally available
docker create -it --name my_container my_image # -it allocates a TTY and keeps STDIN open
docker start my_container #Background (no -i/-a given) + POSSIBILITY for start -i
2