allow flag --target in build process

This commit is contained in:
Marco Vito Moscaritolo
2018-02-07 19:31:10 +01:00
parent af4a2586ce
commit 86388a5be3
2 changed files with 10 additions and 0 deletions

View File

@@ -44,6 +44,7 @@ type (
Tags []string // Docker build tags
Args []string // Docker build args
ArgsEnv []string // Docker build args from env
Target string // Docker build target
Squash bool // Docker build squash
Pull bool // Docker build pull
Compress bool // Docker build compress
@@ -204,6 +205,9 @@ func commandBuild(build Build) *exec.Cmd {
for _, arg := range build.Args {
args = append(args, "--build-arg", arg)
}
if build.Target != "" {
args = append(args, "--target", build.Target)
}
labelSchema := []string{
fmt.Sprintf("build-date=%s", time.Now().Format(time.RFC3339)),