Stop the running container web and give its main process the normal termination grace period.
Which command is appropriate?
docker stop requests normal termination and waits before force-killing the container process if needed.
Detailed explanation
docker rm webIncorrect. docker rm removes a stopped container.
Incorrect. docker rm removes a stopped container.
docker pause webIncorrect. docker pause suspends processes rather than stopping them normally.
Incorrect. docker pause suspends processes rather than stopping them normally.
docker stop webCorrect. docker stop web performs the graceful stop request.
Correct. docker stop web performs the graceful stop request.
docker rmi webIncorrect. docker rmi removes an image, not a container.
Incorrect. docker rmi removes an image, not a container.
Try it yourself
An example you can run in a temporary verification environment.
docker stop --help 2>/dev/null | head -n 8 || trueExpected result
Dockerがある場合はstopのhelp。containerは停止しないKey points
- docker stop
- Grace period
- Container process
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.