浏览代码

Harmonize / across all name-related commands

Docker-DCO-1.1-Signed-off-by: Djibril Koné <kone.djibril@gmail.com> (github: enokd)

Harmonize / across all name-related commands

Docker-DCO-1.1-Signed-off-by: Djibril Koné <kone.djibril@gmail.com> (github: enokd)

Harmonize / across all name-related commands:Return an error when repeated /

Docker-DCO-1.1-Signed-off-by: Djibril Koné <kone.djibril@gmail.com> (github: enokd)
Djibril Koné 11 年之前
父节点
当前提交
e38e977a04
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      api/client.go

+ 5 - 0
api/client.go

@@ -1452,6 +1452,11 @@ func (cli *DockerCli) CmdCommit(args ...string) error {
 		return nil
 	}
 
+	re := regexp.MustCompile("/{2}")
+	if re.MatchString(repository) {
+		return fmt.Errorf("Error: Bad image name. Please rename your image in the format <user>/<repo>")
+	}
+
 	v := url.Values{}
 	v.Set("container", name)
 	v.Set("repo", repository)