Add build add-host

This commit is contained in:
recamshak
2019-12-11 09:33:26 +09:00
parent 4c09b80365
commit 17639d6cbf
2 changed files with 10 additions and 0 deletions

View File

@@ -52,6 +52,7 @@ type (
LabelSchema []string // label-schema Label map
Labels []string // Label map
NoCache bool // Docker build no-cache
AddHost []string // Docker build add-host
}
// Plugin defines the Docker plugin parameters.
@@ -215,6 +216,9 @@ func commandBuild(build Build) *exec.Cmd {
for _, arg := range build.Args {
args = append(args, "--build-arg", arg)
}
for _, host := range build.AddHost {
args = append(args, "--add-host", host)
}
if build.Target != "" {
args = append(args, "--target", build.Target)
}