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.
docker start webCorrect. docker start web restarts the existing stopped container.
docker exec webIncorrect. docker exec runs a command in a running container.
docker images webIncorrect. 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のみ
- Use a disposable VM or container when validating lifecycle commands.
- Exact command output can vary slightly by distribution and runtime version.
Foundation review
Identify the layer
A stopped container can retain its configuration and writable layer until it is removed; an image is a separate object.
Check the side effect
List the container ID and state before choosing between start and a new run.