Comment 6 for bug 2063099

Revision history for this message
Tomáš Virtus (virtustom) wrote :

@lucaskanashiro,

I think you are trying top stop the container too soon after it's created. The container receives SIGTERM from docker before is sets up signal handlers, and because it's PID 1, the signal is ignored. Runc then kills it with SIGKILL after 10s.

Try with sleep:

root@cloudimg:~# time docker stop $(docker run --rm -d nginx)
d975cb1c9c088db8ee5ce6d79c36b2931675cfb3ab244eb5effc8f605b357e5f

real 0m10.875s
user 0m0.059s
sys 0m0.066s
root@cloudimg:~# time docker stop $(docker run --rm -d nginx && sleep 1)
bffbc7672f45fcda107371f3d95779e3a45152d03e7a220532ed94dcda4b72a6

real 0m1.750s
user 0m0.066s
sys 0m0.076s