Docker Community Forums

Share and learn in the Docker community.

Timeout before killing a container

docker

(Pascal Stauffer) #1

Hi there,

I would like to know, if it’s possible to configure the time to wait before killing a container, during a docker stop/restart in a permanent way? Like a config-parameter / env variable.

  -t, --time=10      Seconds to wait for stop before killing it

Thanks for your help.

Greets
Pascal


(Jeff Anderson) #2

This can only be set with the command line option: https://github.com/docker/docker/blob/v1.11.0/api/client/stop.go#L20

The server will pretty much honor whatever the client sends it, and the default of 10 appears to be in the docker cli client, and not in the server.