Merge pull request #274 from gary-kim/enh/noid/quiet-option

Add quiet build option
This commit is contained in:
Thomas Boerger 2020-05-18 09:41:22 +02:00 committed by GitHub
commit b5598ee56d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View File

@ -147,6 +147,11 @@ func main() {
Usage: "build args",
EnvVar: "PLUGIN_BUILD_ARGS_FROM_ENV",
},
cli.BoolFlag{
Name: "quiet",
Usage: "quiet docker build",
EnvVar: "PLUGIN_QUIET",
},
cli.StringFlag{
Name: "target",
Usage: "build target",
@ -269,6 +274,7 @@ func run(c *cli.Context) error {
LabelSchema: c.StringSlice("label-schema"),
NoCache: c.Bool("no-cache"),
AddHost: c.StringSlice("add-host"),
Quiet: c.Bool("quiet"),
},
Daemon: docker.Daemon{
Registry: c.String("docker.registry"),

View File

@ -56,6 +56,7 @@ type (
Labels []string // Label map
NoCache bool // Docker build no-cache
AddHost []string // Docker build add-host
Quiet bool // Docker build quiet
}
// Plugin defines the Docker plugin parameters.
@ -243,6 +244,9 @@ func commandBuild(build Build) *exec.Cmd {
if build.Target != "" {
args = append(args, "--target", build.Target)
}
if build.Quiet {
args = append(args, "--quiet")
}
labelSchema := []string{
"schema-version=1.0",