make cache-from an array
This commit is contained in:
committed by
Ryan Sullivan
parent
a48b59645a
commit
008bbaf47b
10
docker.go
10
docker.go
@@ -47,7 +47,7 @@ type (
|
||||
Target string // Docker build target
|
||||
Squash bool // Docker build squash
|
||||
Pull bool // Docker build pull
|
||||
CacheFrom string // Docker build cache-from
|
||||
CacheFrom []string // Docker build cache-from
|
||||
Compress bool // Docker build compress
|
||||
Repo string // Docker build repository
|
||||
LabelSchema []string // label-schema Label map
|
||||
@@ -106,8 +106,8 @@ func (p Plugin) Exec() error {
|
||||
}
|
||||
|
||||
// pre-pull cache image
|
||||
if p.Build.CacheFrom != "" {
|
||||
cmd := commandPull(p.Build.CacheFrom)
|
||||
for _, img := range p.Build.CacheFrom {
|
||||
cmd := commandPull(img)
|
||||
cmd.Stdout = os.Stdout
|
||||
cmd.Stderr = os.Stderr
|
||||
trace(cmd)
|
||||
@@ -218,8 +218,8 @@ func commandBuild(build Build) *exec.Cmd {
|
||||
if build.NoCache {
|
||||
args = append(args, "--no-cache")
|
||||
}
|
||||
if build.CacheFrom != "" {
|
||||
args = append(args, "--cache-from", build.CacheFrom)
|
||||
for _, arg := range build.CacheFrom {
|
||||
args = append(args, "--cache-from", arg)
|
||||
}
|
||||
for _, arg := range build.ArgsEnv {
|
||||
addProxyValue(&build, arg)
|
||||
|
||||
Reference in New Issue
Block a user