mirror of
https://github.com/thegeeklab/wp-docker-buildx.git
synced 2024-11-22 20:20:39 +00:00
Merge pull request #256 from recamshak/build-add-host
Add build add-host
This commit is contained in:
commit
1f0cfcc3ef
@ -223,6 +223,11 @@ func main() {
|
||||
Usage: "do not use cached intermediate containers",
|
||||
EnvVar: "PLUGIN_NO_CACHE",
|
||||
},
|
||||
cli.StringSliceFlag{
|
||||
Name: "add-host",
|
||||
Usage: "additional host:IP mapping",
|
||||
EnvVar: "PLUGIN_ADD_HOST",
|
||||
},
|
||||
}
|
||||
|
||||
if err := app.Run(os.Args); err != nil {
|
||||
@ -257,6 +262,7 @@ func run(c *cli.Context) error {
|
||||
Labels: c.StringSlice("custom-labels"),
|
||||
LabelSchema: c.StringSlice("label-schema"),
|
||||
NoCache: c.Bool("no-cache"),
|
||||
AddHost: c.StringSlice("add-host"),
|
||||
},
|
||||
Daemon: docker.Daemon{
|
||||
Registry: c.String("docker.registry"),
|
||||
|
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user