mirror of
https://github.com/thegeeklab/wp-docker-buildx.git
synced 2024-11-09 17:20:39 +00:00
append users build-args to the default slice
This commit is contained in:
parent
113599ff08
commit
410d80eb98
@ -71,6 +71,10 @@ func commandBuild(build Build) *exec.Cmd {
|
||||
"-t", build.Name,
|
||||
}
|
||||
|
||||
defaultBuildArgs := []string{
|
||||
fmt.Sprintf("DOCKER_IMAGE_CREATED=%s", time.Now().Format(time.RFC3339)),
|
||||
}
|
||||
|
||||
args = append(args, build.Context)
|
||||
if build.Squash {
|
||||
args = append(args, "--squash")
|
||||
@ -90,7 +94,7 @@ func commandBuild(build Build) *exec.Cmd {
|
||||
for _, arg := range build.ArgsEnv.Value() {
|
||||
addProxyValue(&build, arg)
|
||||
}
|
||||
for _, arg := range build.Args.Value() {
|
||||
for _, arg := range append(defaultBuildArgs, build.Args.Value()...) {
|
||||
args = append(args, "--build-arg", arg)
|
||||
}
|
||||
for _, host := range build.AddHost.Value() {
|
||||
@ -107,9 +111,6 @@ func commandBuild(build Build) *exec.Cmd {
|
||||
args = append(args, "--platform", strings.Join(build.Platforms.Value()[:], ","))
|
||||
}
|
||||
|
||||
// append generated build args
|
||||
args = append(args, "--build-arg", fmt.Sprintf("DOCKER_IMAGE_CREATED=%s", time.Now().Format(time.RFC3339)))
|
||||
|
||||
return exec.Command(dockerExe, args...)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user