mirror of
https://github.com/rancher/os.git
synced 2025-07-18 17:11:04 +00:00
If image has no tag assume :latest, not all images
This commit is contained in:
parent
2462067015
commit
34ac3236d4
@ -12,6 +12,7 @@ import (
|
|||||||
|
|
||||||
log "github.com/Sirupsen/logrus"
|
log "github.com/Sirupsen/logrus"
|
||||||
flag "github.com/docker/docker/pkg/mflag"
|
flag "github.com/docker/docker/pkg/mflag"
|
||||||
|
"github.com/docker/docker/pkg/parsers"
|
||||||
"github.com/docker/docker/runconfig"
|
"github.com/docker/docker/runconfig"
|
||||||
shlex "github.com/flynn/go-shlex"
|
shlex "github.com/flynn/go-shlex"
|
||||||
dockerClient "github.com/fsouza/go-dockerclient"
|
dockerClient "github.com/fsouza/go-dockerclient"
|
||||||
@ -306,8 +307,13 @@ func (c *Container) Stage() *Container {
|
|||||||
|
|
||||||
_, err = client.InspectImage(c.Config.Image)
|
_, err = client.InspectImage(c.Config.Image)
|
||||||
if err == dockerClient.ErrNoSuchImage {
|
if err == dockerClient.ErrNoSuchImage {
|
||||||
|
toPull := c.Config.Image
|
||||||
|
_, tag := parsers.ParseRepositoryTag(toPull)
|
||||||
|
if tag == "" {
|
||||||
|
toPull += ":latest"
|
||||||
|
}
|
||||||
c.Err = client.PullImage(dockerClient.PullImageOptions{
|
c.Err = client.PullImage(dockerClient.PullImageOptions{
|
||||||
Repository: c.Config.Image,
|
Repository: toPull,
|
||||||
OutputStream: os.Stdout,
|
OutputStream: os.Stdout,
|
||||||
}, dockerClient.AuthConfiguration{})
|
}, dockerClient.AuthConfiguration{})
|
||||||
} else if err != nil {
|
} else if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user