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]

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.

Privacy Overview
Referbruv

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

Strictly Necessary Cookies

Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings.

3rd Party Cookies

This website uses Google Analytics to collect anonymous information such as the number of visitors to the site, and the most popular pages.

Keeping this cookie enabled helps us to improve our website.