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
@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) 8ee5ce6d79c36b2 931675cfb3ab244 eb5effc8f605b35 7e5f
d975cb1c9c088db
real 0m10.875s a107371f3d95779 e3a45152d03e7a2 20532ed94dcda4b 72a6
user 0m0.059s
sys 0m0.066s
root@cloudimg:~# time docker stop $(docker run --rm -d nginx && sleep 1)
bffbc7672f45fcd
real 0m1.750s
user 0m0.066s
sys 0m0.076s