Skip to content

Commit

Permalink
fix: load (#1990)
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
  • Loading branch information
caarlos0 committed Jan 4, 2021
1 parent badf7ba commit 5a0f0f6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion internal/pipe/docker/docker.go
Expand Up @@ -273,7 +273,7 @@ func dockerBuild(ctx *context.Context, root string, images, flags []string, buil
func buildCommand(buildx bool, images, flags []string) []string {
base := []string{"build", "."}
if buildx {
base = []string{"buildx", "build", "."}
base = []string{"buildx", "build", ".", "--load"}
}
for _, image := range images {
base = append(base, "-t", image)
Expand Down
15 changes: 7 additions & 8 deletions internal/pipe/docker/docker_test.go
Expand Up @@ -144,7 +144,7 @@ func TestRunPipe(t *testing.T) {
"multiarch with buildx": {
dockers: []config.Docker{
{
ImageTemplates: []string{registry + "goreleaser/test_multiarch_buildx:test-amd64"},
ImageTemplates: []string{registry + "goreleaser/test_multiarch_buildx:amd64"},
Goos: "linux",
Goarch: "amd64",
Dockerfile: "testdata/Dockerfile",
Expand All @@ -153,7 +153,7 @@ func TestRunPipe(t *testing.T) {
BuildFlagTemplates: []string{"--platform=linux/amd64"},
},
{
ImageTemplates: []string{registry + "goreleaser/test_multiarch_buildx:test-arm64v8"},
ImageTemplates: []string{registry + "goreleaser/test_multiarch_buildx:arm64v8"},
Goos: "linux",
Goarch: "arm64",
Dockerfile: "testdata/Dockerfile",
Expand All @@ -164,19 +164,18 @@ func TestRunPipe(t *testing.T) {
},
manifests: []config.DockerManifest{
{
// XXX: fails if :latest https://github.com/docker/distribution/issues/3100
NameTemplate: registry + "goreleaser/test_multiarch_buildx:test",
ImageTemplates: []string{
registry + "goreleaser/test_multiarch_buildx:test-amd64",
registry + "goreleaser/test_multiarch_buildx:test-arm64v8",
registry + "goreleaser/test_multiarch_buildx:amd64",
registry + "goreleaser/test_multiarch_buildx:arm64v8",
},
CreateFlags: []string{"--insecure"},
PushFlags: []string{"--insecure"},
},
},
expect: []string{
registry + "goreleaser/test_multiarch_buildx:test-amd64",
registry + "goreleaser/test_multiarch_buildx:test-arm64v8",
registry + "goreleaser/test_multiarch_buildx:amd64",
registry + "goreleaser/test_multiarch_buildx:arm64v8",
},
assertError: shouldNotErr,
pubAssertError: shouldNotErr,
Expand Down Expand Up @@ -911,7 +910,7 @@ func TestBuildCommand(t *testing.T) {
name: "buildx",
buildx: true,
flags: []string{"--label=foo", "--build-arg=bar=baz"},
expect: []string{"buildx", "build", ".", "-t", images[0], "-t", images[1], "--label=foo", "--build-arg=bar=baz"},
expect: []string{"buildx", "build", ".", "--load", "-t", images[0], "-t", images[1], "--label=foo", "--build-arg=bar=baz"},
},
}
for _, tt := range tests {
Expand Down

1 comment on commit 5a0f0f6

@vercel
Copy link

@vercel vercel bot commented on 5a0f0f6 Jan 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.