github.com/vvnotw/moby@v1.13.1/client/container_start.go (about) 1 package client 2 3 import ( 4 "net/url" 5 6 "golang.org/x/net/context" 7 8 "github.com/docker/docker/api/types" 9 ) 10 11 // ContainerStart sends a request to the docker daemon to start a container. 12 func (cli *Client) ContainerStart(ctx context.Context, containerID string, options types.ContainerStartOptions) error { 13 query := url.Values{} 14 if len(options.CheckpointID) != 0 { 15 query.Set("checkpoint", options.CheckpointID) 16 } 17 if len(options.CheckpointDir) != 0 { 18 query.Set("checkpoint-dir", options.CheckpointDir) 19 } 20 21 resp, err := cli.post(ctx, "/containers/"+containerID+"/start", query, nil, nil) 22 ensureReaderClosed(resp) 23 return err 24 }