Docker stop: Difference between revisions
Jump to navigation
Jump to search
Line 9: | Line 9: | ||
=Overview= | =Overview= | ||
Stop a running container by sending [[Linux_Signals#SIGTERM_.2815.29|SIGTERM]] and then SIGKILL after a grace period: | Stop a running container by sending [[Linux_Signals#SIGTERM_.2815.29|SIGTERM]] and then [[Linux_Signals#SIGKILL_.289.29|SIGKILL]] after a grace period: | ||
docker stop <''options''> <''container-id''> <''container-id''> ... | docker stop <''options''> <''container-id''> <''container-id''> ... | ||
The stop command preserves the container's [[Docker_Concepts#Difference_Between_Containers_and_Images_-_a_Writable_Layer|writable layer]], so when the container is restarted with [[docker start]], the transient state preserved in the [[Docker_Concepts#Container_Image|container's image]] by the previous runs is not lost. That state is only lost when the container is deleted with [[docker rm]]. | The stop command preserves the container's [[Docker_Concepts#Difference_Between_Containers_and_Images_-_a_Writable_Layer|writable layer]], so when the container is restarted with [[docker start]], the transient state preserved in the [[Docker_Concepts#Container_Image|container's image]] by the previous runs is not lost. That state is only lost when the container is deleted with [[docker rm]]. |
Revision as of 19:26, 29 January 2018
External
Internal
Overview
Stop a running container by sending SIGTERM and then SIGKILL after a grace period:
docker stop <options> <container-id> <container-id> ...
The stop command preserves the container's writable layer, so when the container is restarted with docker start, the transient state preserved in the container's image by the previous runs is not lost. That state is only lost when the container is deleted with docker rm.