What is the difference between docker run
and docker create
commands?
I usually use run
but sometimes in documentation I see create
.
Docker's --help
tells
create Create a new container
run Run a command in a new container
Does it mean that run
is used when we need to pass a command to a new container? What's the aim of create
then?
From docker documentation
The docker create command creates a writeable container layer over the specified image and prepares it for running the specified command. The container ID is then printed to STDOUT. This is similar to docker run -d except the container is never started. You can then use the docker start command to start the container at any point.
This is useful when you want to set up a container configuration ahead of time so that it is ready to start when you need it. The initial status of the new container is created.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments