mirror of
https://github.com/genuinetools/reg.git
synced 2024-08-21 06:10:23 -04:00
22 lines
563 B
Go
22 lines
563 B
Go
![]() |
package client // import "github.com/docker/docker/client"
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"net/url"
|
||
|
|
||
|
"github.com/docker/docker/api/types/versions"
|
||
|
)
|
||
|
|
||
|
// VolumeRemove removes a volume from the docker host.
|
||
|
func (cli *Client) VolumeRemove(ctx context.Context, volumeID string, force bool) error {
|
||
|
query := url.Values{}
|
||
|
if versions.GreaterThanOrEqualTo(cli.version, "1.25") {
|
||
|
if force {
|
||
|
query.Set("force", "1")
|
||
|
}
|
||
|
}
|
||
|
resp, err := cli.delete(ctx, "/volumes/"+volumeID, query, nil)
|
||
|
ensureReaderClosed(resp)
|
||
|
return wrapResponseError(err, resp, "volume", volumeID)
|
||
|
}
|