Skip to content

Commit 23c6d3c

Browse files
committed
tagging latest image was not supported for buildx builds
1 parent 7797afb commit 23c6d3c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

cmd/bob/build.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,16 @@ func buildAndPushOneDockerImage(dockerImage DockerImageSpec, buildCtx *BuildCont
100100
"build",
101101
"--platform", strings.Join(dockerImage.Platforms, ","),
102102
"--file", dockerfilePath,
103-
"--tag", tag,
104103
"--label=org.opencontainers.image.revision=" + buildCtx.RevisionId.RevisionId,
105-
".",
104+
"--tag=" + tag,
106105
}
107106

107+
if dockerImage.TagLatest {
108+
args = append(args, "--tag="+tagLatest)
109+
}
110+
111+
args = append(args, ".") // build context
112+
108113
if buildCtx.PublishArtefacts {
109114
// the build command has integrated push support. we'd actually prefer to separate
110115
// these stages, but multi-arch manifests aren't supported storing locally so we've

0 commit comments

Comments
 (0)