a1e67401d2
- updated the default value for `--limit` on `docker search` as the const has been removed (added a todo to remove it) - updated some fixtures to account for `KernelMemoryTCP` no longer being included in the output. full diff: https://github.com/docker/docker/compare/83b51522df43866e39f7c757a6ab84ef4050eeb3...8941dcfcc5db4aefc351cd5b5bb4d524823035c0 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
28 lines
623 B
Go
28 lines
623 B
Go
package client // import "github.com/docker/docker/client"
|
|
|
|
import (
|
|
"context"
|
|
"net/url"
|
|
|
|
"github.com/docker/docker/api/types"
|
|
)
|
|
|
|
// ContainerRemove kills and removes a container from the docker host.
|
|
func (cli *Client) ContainerRemove(ctx context.Context, containerID string, options types.ContainerRemoveOptions) error {
|
|
query := url.Values{}
|
|
if options.RemoveVolumes {
|
|
query.Set("v", "1")
|
|
}
|
|
if options.RemoveLinks {
|
|
query.Set("link", "1")
|
|
}
|
|
|
|
if options.Force {
|
|
query.Set("force", "1")
|
|
}
|
|
|
|
resp, err := cli.delete(ctx, "/containers/"+containerID, query, nil)
|
|
defer ensureReaderClosed(resp)
|
|
return err
|
|
}
|