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.
docker pause webIncorrect. docker pause suspends processes rather than stopping them normally.
docker stop webCorrect. docker stop web performs the graceful stop request.
docker rmi webIncorrect. 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のみ
- 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
Removing a container, pausing processes, and deleting an image do not provide the same lifecycle transition as stopping.
Check the side effect
Confirm the application handles its termination signal before relying on a graceful stop for stateful workloads.