mirror of
https://github.com/clearlinux/docker.git
synced 2026-09-05 13:11:30 +00:00
fix docker rm name issue
Addresses https://github.com/docker/docker/issues/12308 Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
This commit is contained in:
@@ -3,6 +3,7 @@ package client
|
||||
import (
|
||||
"fmt"
|
||||
"net/url"
|
||||
"strings"
|
||||
|
||||
flag "github.com/docker/docker/pkg/mflag"
|
||||
)
|
||||
@@ -36,6 +37,7 @@ func (cli *DockerCli) CmdRm(args ...string) error {
|
||||
if name == "" {
|
||||
return fmt.Errorf("Container name cannot be empty")
|
||||
}
|
||||
name = strings.Trim(name, "/")
|
||||
|
||||
_, _, err := readBody(cli.call("DELETE", "/containers/"+name+"?"+val.Encode(), nil, nil))
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user