Skip to content

Commit 9b9bf46

Browse files
committed
Add container_from_explicit
1 parent 4c9a902 commit 9b9bf46

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

cmd/drone-docker/main.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,11 @@ func main() {
183183
Usage: "images to consider as cache sources",
184184
EnvVar: "PLUGIN_CACHE_FROM",
185185
},
186+
cli.StringFlag{
187+
Name: "cache-from-explicit",
188+
Usage: "image to consider as cache source fully specified",
189+
EnvVar: "PLUGIN_CACHE_FROM_EXPLICIT",
190+
},
186191
cli.StringFlag{
187192
Name: "cache-to",
188193
Usage: "images to consider as cache stores",

docker.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ type (
6161
Squash bool // Docker build squash
6262
Pull bool // Docker build pull
6363
CacheFrom []string // Docker build cache-from
64+
CacheFromExplicit string // Docker build cache-from with comma support
6465
CacheTo string // Docker build cache-to
6566
Compress bool // Docker build compress
6667
Repo string // Docker build repository
@@ -415,6 +416,9 @@ func commandBuild(build Build) *exec.Cmd {
415416
for _, arg := range build.CacheFrom {
416417
args = append(args, "--cache-from", arg)
417418
}
419+
if build.CacheFromExplicit != "" {
420+
args = append(args, "--cache-from", build.CacheFromExplicit)
421+
}
418422
if build.CacheTo != "" {
419423
args = append(args, "--cache-to", build.CacheTo)
420424
}

0 commit comments

Comments
 (0)