Merge pull request #171 from viant/patch-nocache

Add no-cache option
This commit is contained in:
Brad Rydzewski 2018-02-21 11:56:08 -08:00 committed by GitHub
commit 938e42ccc0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View File

@ -202,6 +202,11 @@ func main() {
Usage: "repository default branch",
EnvVar: "DRONE_REPO_BRANCH",
},
cli.BoolFlag{
Name: "no-cache",
Usage: "do not use cached intermediate containers",
EnvVar: "PLUGIN_NO_CACHE",
},
}
if err := app.Run(os.Args); err != nil {
@ -232,6 +237,7 @@ func run(c *cli.Context) error {
Compress: c.Bool("compress"),
Repo: c.String("repo"),
LabelSchema: c.StringSlice("label-schema"),
NoCache: c.Bool("no-cache"),
},
Daemon: docker.Daemon{
Registry: c.String("docker.registry"),

View File

@ -49,6 +49,7 @@ type (
Compress bool // Docker build compress
Repo string // Docker build repository
LabelSchema []string // Label schema map
NoCache bool // Docker build no-cache
}
// Plugin defines the Docker plugin parameters.
@ -198,6 +199,9 @@ func commandBuild(build Build) *exec.Cmd {
if build.Pull {
args = append(args, "--pull=true")
}
if build.NoCache {
args = append(args, "--no-cache")
}
for _, arg := range build.ArgsEnv {
addProxyValue(&build, arg)
}