What is the difference between a START and RUN command?

START command is used to start an already created container. On the other hand, a RUN command is used to CREATE and START a non-existing container from a specified image.

So basically a docker RUN command does both CREATE and START commands combined.


> docker run [options] <image_name> [initial_command]

To deploy and run an application in a Docker container, you have two options –

  1. You can use docker start command (or)
  2. Use the docker run command

Which one do you use and under which scenarios you use run and start commands?

docker start command

START command is used to start an already created container.

You pass the container identifiers as arguments to the command and docker starts those containers.

a START command generally follows a BUILD command where a new container image is built.


docker start [OPTIONS] CONTAINER [CONTAINER...]

docker run command

On the other hand, a RUN command is used to CREATE and START a non-existing container from a specified image.

docker run [options] <image_name> [initial_command]


Buy Me A Coffee

Found this article helpful? Please consider supporting!

Ram
Ram

I'm a full-stack developer and a software enthusiast who likes to play around with cloud and tech stack out of curiosity. You can connect with me on Medium, Twitter or LinkedIn.

Leave a Reply

Your email address will not be published. Required fields are marked *