Docker commands sometimes leave us confused about its use and an example of these is the difference between docker run and docker start.
Upon running the “docker run” command, it creates a new container of an image, and execute the container. Also, you can create clones of the same image. You can use the command by:
docker run IMAGE_ID
and notdocker run CONTAINER_ID
The command “docker start” launches a container previously stopped. An example of this is if you had stopped a database with the command docker stop CONTAINER_ID
, you can relaunch the same container with the command docker start CONTAINER_ID
, and the data and settings will be the same. You can use the command by:
docker start CONTAINER_ID