mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-01 22:31:15 +00:00
25 lines
659 B
Go
25 lines
659 B
Go
|
package docker // import "docker.io/go-docker"
|
||
|
|
||
|
import (
|
||
|
"net/url"
|
||
|
|
||
|
"golang.org/x/net/context"
|
||
|
|
||
|
"docker.io/go-docker/api/types"
|
||
|
)
|
||
|
|
||
|
// ContainerStart sends a request to the docker daemon to start a container.
|
||
|
func (cli *Client) ContainerStart(ctx context.Context, containerID string, options types.ContainerStartOptions) error {
|
||
|
query := url.Values{}
|
||
|
if len(options.CheckpointID) != 0 {
|
||
|
query.Set("checkpoint", options.CheckpointID)
|
||
|
}
|
||
|
if len(options.CheckpointDir) != 0 {
|
||
|
query.Set("checkpoint-dir", options.CheckpointDir)
|
||
|
}
|
||
|
|
||
|
resp, err := cli.post(ctx, "/containers/"+containerID+"/start", query, nil, nil)
|
||
|
ensureReaderClosed(resp)
|
||
|
return err
|
||
|
}
|