Explain `docker stop` vs `docker kill`.
BeginnerConceptContainers, VMs & Isolation Internals
Answer
docker stop sends SIGTERM (or the image's STOPSIGNAL), waits 10 seconds by default (-t to change), then sends SIGKILL. docker kill sends SIGKILL immediately (or any signal via -s). Graceful shutdown depends on your app handling SIGTERM as PID 1.
More on Containers, VMs & Isolation Internals
What is a container, in one sentence?BeginnerHow do containers differ from virtual machines?BeginnerCan a Linux container run a Windows application, or the reverse?IntermediateWhat are Linux namespaces? Name the ones Docker uses.BeginnerWhat are cgroups and what do they do for containers?BeginnerWhat is PID 1 in a container and why does it matter?Intermediate