如果在容器内运行的进程无法停止,docker会停止吗?如果我使用docker kill,可以保留容器内未保存的数据.与docker kill相比,docker停止耗时吗?我想关闭容器但不丢失任何数据(没有高延迟来完成终止或停止进程).
最佳答案
Line reference:
docker stop
: Stop a running container (send SIGTERM,and then SIGKILL
after grace period) […] The main process inside the container will
receive SIGTERM,and after a grace period,SIGKILL. [emphasis mine]
docker kill
: Kill a running container (send SIGKILL,or specified
signal) […] The main process inside the container will be sent
SIGKILL,or any signal specified with option –signal. [emphasis mine]
您可以从这篇文章中获得更多信息:https://superuser.com/questions/756999/whats-the-difference-between-docker-stop-and-docker-kill