Docker create vs run: prepare or start
Quick answer
Use docker create to prepare a container without launching its program. Use docker run to create a new container and start it in one step. Use docker start to launch a container that already exists.
Before you run commands
Use an approved disposable Linux-container Docker lab. Confirm the effective context and permissions; use a reviewed, locally preloaded busybox:1.37 image whose digest/platform the lab owner has recorded. This tag is mutable. Do not download an image automatically; --pull=never requires it locally. The new containers use --network none, with no host mounts or published ports; the CLI still connects to the selected engine. Verify the approved image tag still resolves to the recorded image before creating containers. Check docker ps -a for all names used below. If any is occupied, choose fresh names consistently. Run commands one at a time and stop on any unexpected failure; never act on resources you did not create. Expected results are predictions, not measured execution.
How it works
In this lab, the image contains a small shell (sh). The arguments after the image tell that shell to print a message (-c means execute the following command string). Creation returns an ID; the program has not printed anything yet. Start with -a to see its output. After the program finishes, the container is exited. Think of the sequence as image → created → running → exited.
docker create --pull=never --network none --name bm02-create busybox:1.37 sh -c 'echo ready'docker ps -adocker start -a bm02-createdocker ps -adocker rm bm02-createExpect a created row before start, then ready and an exited row. IDs and timestamps vary. The ID from create is not application output. If start fails, do not continue to removal until the object’s ownership and state have been confirmed.
Common mistake
Running the same docker run --name ... again does not resume the old container. A name already in use causes a conflict. Start the existing container or deliberately create a different one with a free name.
Try it yourself
Predict the state after each command, then repeat with a different message and unused name. Explain why create alone produces no application output.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Docker create vs run: prepare or start — knowledge check
Apply the lifecycle concepts and interpret the lab behavior.
Which command prepares a container without launching its program?
What does start -a do for a created greeting container?
Why does the greeting container become exited?