fix(container): prevent base image pull for non-registry containers
This commit is contained in:
parent
77547cedce
commit
2df0d81782
@ -178,6 +178,9 @@ type Container struct {
|
|||||||
// Additional arguments
|
// Additional arguments
|
||||||
Args []string
|
Args []string
|
||||||
|
|
||||||
|
// Base of container is local-only
|
||||||
|
LocalBase bool
|
||||||
|
|
||||||
Log zerolog.Logger
|
Log zerolog.Logger
|
||||||
|
|
||||||
commandsOutput struct {
|
commandsOutput struct {
|
||||||
@ -428,7 +431,10 @@ func (c Container) build(imagePath string) (output string, err error) {
|
|||||||
|
|
||||||
args := []string{"build"}
|
args := []string{"build"}
|
||||||
if !UseCache {
|
if !UseCache {
|
||||||
args = append(args, "--pull", "--no-cache")
|
if !c.LocalBase {
|
||||||
|
args = append(args, "--pull")
|
||||||
|
}
|
||||||
|
args = append(args, "--no-cache")
|
||||||
}
|
}
|
||||||
args = append(args, "-t", c.name, imagePath)
|
args = append(args, "-t", c.name, imagePath)
|
||||||
|
|
||||||
|
@ -57,6 +57,8 @@ func (suse OpenSUSE) Packages() (pkgs []string, err error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
c.LocalBase = true
|
||||||
|
|
||||||
} else if strings.HasPrefix(suse.release, "13") {
|
} else if strings.HasPrefix(suse.release, "13") {
|
||||||
name = "opensuse:13"
|
name = "opensuse:13"
|
||||||
cnturl := cache.ContainerURL("openSUSE-13.2")
|
cnturl := cache.ContainerURL("openSUSE-13.2")
|
||||||
@ -64,6 +66,8 @@ func (suse OpenSUSE) Packages() (pkgs []string, err error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
c.LocalBase = true
|
||||||
|
|
||||||
} else if strings.HasPrefix(suse.release, "42") {
|
} else if strings.HasPrefix(suse.release, "42") {
|
||||||
name = "opensuse/leap:42"
|
name = "opensuse/leap:42"
|
||||||
} else if strings.HasPrefix(suse.release, "15") {
|
} else if strings.HasPrefix(suse.release, "15") {
|
||||||
|
Loading…
Reference in New Issue
Block a user