full diff: https://github.com/docker/docker/compare/v27.5.1..v28.0.0-rc.1 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
16 lines
456 B
Go
16 lines
456 B
Go
package client // import "github.com/docker/docker/client"
|
|
|
|
import "context"
|
|
|
|
// ContainerPause pauses the main process of a given container without terminating it.
|
|
func (cli *Client) ContainerPause(ctx context.Context, containerID string) error {
|
|
containerID, err := trimID("container", containerID)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
resp, err := cli.post(ctx, "/containers/"+containerID+"/pause", nil, nil, nil)
|
|
ensureReaderClosed(resp)
|
|
return err
|
|
}
|