1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-11-06 09:09:29 +02:00

fix: use default builder with buildx (#3199)

Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2022-06-24 21:13:33 +02:00
committed by GitHub
parent 82c64f54ff
commit b1a3f301e7
3 changed files with 23 additions and 2 deletions

View File

@@ -61,7 +61,7 @@ func (i dockerImager) Build(ctx *context.Context, root string, images, flags []s
func (i dockerImager) buildCommand(images, flags []string) []string {
base := []string{"build", "."}
if i.buildx {
base = []string{"buildx", "build", ".", "--load"}
base = []string{"buildx", "--builder", "default", "build", ".", "--load"}
}
for _, image := range images {
base = append(base, "-t", image)

View File

@@ -1122,7 +1122,7 @@ func TestBuildCommand(t *testing.T) {
name: "buildx",
buildx: true,
flags: []string{"--label=foo", "--build-arg=bar=baz"},
expect: []string{"buildx", "build", ".", "--load", "-t", images[0], "-t", images[1], "--label=foo", "--build-arg=bar=baz"},
expect: []string{"buildx", "--builder", "default", "build", ".", "--load", "-t", images[0], "-t", images[1], "--label=foo", "--build-arg=bar=baz"},
},
}
for _, tt := range tests {