The previously created container web is stopped.
Start that same container without creating a new one.
Which command is appropriate?
docker start starts a created container that is currently stopped, preserving its configuration and writable state.
Detailed explanation
docker run webIncorrect. docker run would create a new container from an image or configured reference.
Incorrect. docker run would create a new container from an image or configured reference.
docker start webCorrect. docker start web restarts the existing stopped container.
Correct. docker start web restarts the existing stopped container.
docker exec webIncorrect. docker exec runs a command in a running container.
Incorrect. docker exec runs a command in a running container.
docker images webIncorrect. docker images lists local images.
Incorrect. docker images lists local images.
Try it yourself
An example you can run in a temporary verification environment.
docker start --help 2>/dev/null | head -n 5 || trueExpected result
Dockerがある場合はstartのhelp。containerは起動しないKey points
- docker start
- Existing container
- Difference from run
Notes
- Environment: Docker CLI helpのみ
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.