|
@@ -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)
|
|
stream, statusCode, err := cli.call("POST", "/containers/create?"+containerValues.Encode(), mergedConfig, false)
|
|
//if image not found try to pull it
|
|
//if image not found try to pull it
|
|
if statusCode == 404 {
|
|
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
|
|
// we don't want to write to stdout anything apart from container.ID
|
|
if err = cli.pullImageCustomOut(config.Image, cli.err); err != nil {
|
|
if err = cli.pullImageCustomOut(config.Image, cli.err); err != nil {
|