David K. Bainbridge | 215e024 | 2017-09-05 23:18:24 -0700 | [diff] [blame] | 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 | } |