Browse Source

Merge pull request #9270 from jfrazelle/8919-tag-output

Output image with tag name when image is not found
unclejack 10 years ago
parent
commit
07b7bdb4fc
1 changed files with 5 additions and 1 deletions
  1. 5 1
      api/client/commands.go

+ 5 - 1
api/client/commands.go

@@ -2158,7 +2158,11 @@ func (cli *DockerCli) createContainer(config *runconfig.Config, hostConfig *runc
 	stream, statusCode, err := cli.call("POST", "/containers/create?"+containerValues.Encode(), mergedConfig, false)
 	//if image not found try to pull it
 	if statusCode == 404 {
-		fmt.Fprintf(cli.err, "Unable to find image '%s' locally\n", config.Image)
+		repo, tag := parsers.ParseRepositoryTag(config.Image)
+		if tag == "" {
+			tag = graph.DEFAULTTAG
+		}
+		fmt.Fprintf(cli.err, "Unable to find image '%s:%s' locally\n", repo, tag)
 
 		// we don't want to write to stdout anything apart from container.ID
 		if err = cli.pullImageCustomOut(config.Image, cli.err); err != nil {