mirror of
https://github.com/thegeeklab/wp-docker-buildx.git
synced 2024-11-22 00:00:40 +00:00
add build_args_from_env parameter
This commit is contained in:
parent
f25b013937
commit
2c6cbdba0d
@ -126,6 +126,11 @@ func main() {
|
||||
Usage: "build args",
|
||||
EnvVar: "PLUGIN_BUILD_ARGS",
|
||||
},
|
||||
cli.StringSliceFlag{
|
||||
Name: "args-from-env",
|
||||
Usage: "build args",
|
||||
EnvVar: "PLUGIN_BUILD_ARGS_FROM_ENV",
|
||||
},
|
||||
cli.BoolFlag{
|
||||
Name: "squash",
|
||||
Usage: "squash the layers at build time",
|
||||
@ -195,6 +200,7 @@ func run(c *cli.Context) error {
|
||||
Context: c.String("context"),
|
||||
Tags: c.StringSlice("tags"),
|
||||
Args: c.StringSlice("args"),
|
||||
ArgsEnv: c.StringSlice("args-from-env"),
|
||||
Squash: c.Bool("squash"),
|
||||
Pull: c.BoolT("pull-image"),
|
||||
Compress: c.Bool("compress"),
|
||||
|
@ -43,6 +43,7 @@ type (
|
||||
Context string // Docker build context
|
||||
Tags []string // Docker build tags
|
||||
Args []string // Docker build args
|
||||
ArgsEnv []string // Docker build args from env
|
||||
Squash bool // Docker build squash
|
||||
Pull bool // Docker build pull
|
||||
Compress bool // Docker build compress
|
||||
@ -194,6 +195,9 @@ func commandBuild(build Build) *exec.Cmd {
|
||||
if build.Pull {
|
||||
args = append(args, "--pull=true")
|
||||
}
|
||||
for _, arg := range build.ArgsEnv {
|
||||
addProxyValue(&build, arg)
|
||||
}
|
||||
for _, arg := range build.Args {
|
||||
args = append(args, "--build-arg", arg)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user