From 34ac3236d4efef4c40bd48ef8ea2387926d16cad Mon Sep 17 00:00:00 2001 From: Darren Shepherd Date: Fri, 17 Apr 2015 06:19:05 -0700 Subject: [PATCH] If image has no tag assume :latest, not all images --- docker/container.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docker/container.go b/docker/container.go index 451ed907..c0d2d187 100644 --- a/docker/container.go +++ b/docker/container.go @@ -12,6 +12,7 @@ import ( log "github.com/Sirupsen/logrus" flag "github.com/docker/docker/pkg/mflag" + "github.com/docker/docker/pkg/parsers" "github.com/docker/docker/runconfig" shlex "github.com/flynn/go-shlex" dockerClient "github.com/fsouza/go-dockerclient" @@ -306,8 +307,13 @@ func (c *Container) Stage() *Container { _, err = client.InspectImage(c.Config.Image) if err == dockerClient.ErrNoSuchImage { + toPull := c.Config.Image + _, tag := parsers.ParseRepositoryTag(toPull) + if tag == "" { + toPull += ":latest" + } c.Err = client.PullImage(dockerClient.PullImageOptions{ - Repository: c.Config.Image, + Repository: toPull, OutputStream: os.Stdout, }, dockerClient.AuthConfiguration{}) } else if err != nil {