Skip to content
This repository was archived by the owner on Aug 29, 2023. It is now read-only.

Commit 410d80e

Browse files
committed
append users build-args to the default slice
1 parent 113599f commit 410d80e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

plugin/docker.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ func commandBuild(build Build) *exec.Cmd {
7171
"-t", build.Name,
7272
}
7373

74+
defaultBuildArgs := []string{
75+
fmt.Sprintf("DOCKER_IMAGE_CREATED=%s", time.Now().Format(time.RFC3339)),
76+
}
77+
7478
args = append(args, build.Context)
7579
if build.Squash {
7680
args = append(args, "--squash")
@@ -90,7 +94,7 @@ func commandBuild(build Build) *exec.Cmd {
9094
for _, arg := range build.ArgsEnv.Value() {
9195
addProxyValue(&build, arg)
9296
}
93-
for _, arg := range build.Args.Value() {
97+
for _, arg := range append(defaultBuildArgs, build.Args.Value()...) {
9498
args = append(args, "--build-arg", arg)
9599
}
96100
for _, host := range build.AddHost.Value() {
@@ -107,9 +111,6 @@ func commandBuild(build Build) *exec.Cmd {
107111
args = append(args, "--platform", strings.Join(build.Platforms.Value()[:], ","))
108112
}
109113

110-
// append generated build args
111-
args = append(args, "--build-arg", fmt.Sprintf("DOCKER_IMAGE_CREATED=%s", time.Now().Format(time.RFC3339)))
112-
113114
return exec.Command(dockerExe, args...)
114115
}
115116

0 commit comments

Comments
 (0)