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