mirror of
https://github.com/thegeeklab/wp-docker-buildx.git
synced 2024-11-28 18:20:35 +00:00
Support --compress docker build flag
This commit is contained in:
parent
07b504834a
commit
f4756f8e39
6
main.go
6
main.go
@ -118,6 +118,11 @@ func main() {
|
|||||||
Usage: "squash the layers at build time",
|
Usage: "squash the layers at build time",
|
||||||
EnvVar: "PLUGIN_SQUASH",
|
EnvVar: "PLUGIN_SQUASH",
|
||||||
},
|
},
|
||||||
|
cli.BoolFlag{
|
||||||
|
Name: "compress",
|
||||||
|
Usage: "compress the build context using gzip",
|
||||||
|
EnvVar: "PLUGIN_COMPRESS",
|
||||||
|
},
|
||||||
cli.StringFlag{
|
cli.StringFlag{
|
||||||
Name: "repo",
|
Name: "repo",
|
||||||
Usage: "docker repository",
|
Usage: "docker repository",
|
||||||
@ -167,6 +172,7 @@ func run(c *cli.Context) error {
|
|||||||
Tags: c.StringSlice("tags"),
|
Tags: c.StringSlice("tags"),
|
||||||
Args: c.StringSlice("args"),
|
Args: c.StringSlice("args"),
|
||||||
Squash: c.Bool("squash"),
|
Squash: c.Bool("squash"),
|
||||||
|
Compress: c.Bool("compress"),
|
||||||
Repo: c.String("repo"),
|
Repo: c.String("repo"),
|
||||||
},
|
},
|
||||||
Daemon: Daemon{
|
Daemon: Daemon{
|
||||||
|
@ -47,6 +47,7 @@ type (
|
|||||||
Tags []string // Docker build tags
|
Tags []string // Docker build tags
|
||||||
Args []string // Docker build args
|
Args []string // Docker build args
|
||||||
Squash bool // Docker build squash
|
Squash bool // Docker build squash
|
||||||
|
Compress bool // Docker build compress
|
||||||
Repo string // Docker build repository
|
Repo string // Docker build repository
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -195,6 +196,9 @@ func commandBuild(build Build) *exec.Cmd {
|
|||||||
if build.Squash {
|
if build.Squash {
|
||||||
args = append(args, "--squash")
|
args = append(args, "--squash")
|
||||||
}
|
}
|
||||||
|
if build.Compress {
|
||||||
|
args = append(args, "--compress")
|
||||||
|
}
|
||||||
for _, arg := range build.Args {
|
for _, arg := range build.Args {
|
||||||
args = append(args, "--build-arg", arg)
|
args = append(args, "--build-arg", arg)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user