瀏覽代碼

Fixing missing tag field when pulling containers which does not exist

Sam Alba 12 年之前
父節點
當前提交
59b785a282
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      commands.go

+ 3 - 1
commands.go

@@ -1242,7 +1242,9 @@ func (cli *DockerCli) CmdRun(args ...string) error {
 	//if image not found try to pull it
 	if statusCode == 404 {
 		v := url.Values{}
-		v.Set("fromImage", config.Image)
+		repos, tag := utils.ParseRepositoryTag(config.Image)
+		v.Set("fromImage", repos)
+		v.Set("tag", tag)
 		err = cli.stream("POST", "/images/create?"+v.Encode(), nil, cli.err)
 		if err != nil {
 			return err