container_pause.go 368 B

12345678910
  1. package client // import "github.com/docker/docker/client"
  2. import "context"
  3. // ContainerPause pauses the main process of a given container without terminating it.
  4. func (cli *Client) ContainerPause(ctx context.Context, containerID string) error {
  5. resp, err := cli.post(ctx, "/containers/"+containerID+"/pause", nil, nil, nil)
  6. ensureReaderClosed(resp)
  7. return err
  8. }