In this article we will look at the differences between docker run
and docker start
command. We will discuss which one to use and when.
docker run | docker start |
---|---|
This command is used on docker images | This command is used on docker containers |
It creates a new container | This starts an existing container |
It can download an image, if not already, then create container | It can’t create a container |
We can provide extra parameters here like container name, bind ports etc. | We can’t modify container with this command |
Using docker run
To start a container using image, run this command –
docker run node
Adding a custom name to the container –
docker run node --name my-node-container
Using docker start
Run an existing container using this command –
docker start <container_id>
Or
docker start <container_name> // for ex - docker start my-node-container
Kubernetes Series
- Introduction to Kubernetes
- Introduction to Docker, Containers, Images & Repository
- Install and Run Docker Images
- Docker Image – FROM, RUN, COPY, ENTRYPOINT, CMD, EXPOSE explained
- Why docker run or start command not running my container?
- How to list all docker images in system?
- How to list all docker containers?
- How to start/stop a docker container?
- Difference between docker run and docker start
- How to bind docker container port with host?
- How to get logs of docker container?
- How to live stream logs of docker container?
- Set custom name to a docker container
- Access docker container filesystem & terminal
- Getting docker details using docker inspect
- Kyverno – Installation, Policies, Testing, Reporting, Monitoring, Security
- Complete Kubernetes Project Step By Step
- Introduction to Kubernetes Objects