Merge pull request #9270 from jfrazelle/8919-tag-output
Output image with tag name when image is not found
This commit is contained in:
commit
07b7bdb4fc
1 changed files with 5 additions and 1 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue