github.com/opsramp/moby@v1.13.1/client/container_kill.go (about) 1 package client 2 3 import ( 4 "net/url" 5 6 "golang.org/x/net/context" 7 ) 8 9 // ContainerKill terminates the container process but does not remove the container from the docker host. 10 func (cli *Client) ContainerKill(ctx context.Context, containerID, signal string) error { 11 query := url.Values{} 12 query.Set("signal", signal) 13 14 resp, err := cli.post(ctx, "/containers/"+containerID+"/kill", query, nil, nil) 15 ensureReaderClosed(resp) 16 return err 17 }