diff --git a/bake/bake_test.go b/bake/bake_test.go index 39f9ad057774..80d96d50dbef 100644 --- a/bake/bake_test.go +++ b/bake/bake_test.go @@ -259,6 +259,25 @@ func TestPushOverride(t *testing.T) { require.Equal(t, 1, len(m["app"].Outputs)) require.Equal(t, "type=image,push=true", m["app"].Outputs[0]) + + fp = File{ + Name: "docker-bake.hcl", + Data: []byte( + `target "foo" { + output = [ "type=local,dest=out" ] + } + target "bar" { + }`), + } + ctx = context.TODO() + m, _, err = ReadTargets(ctx, []File{fp}, []string{"foo", "bar"}, []string{"*.push=true"}, nil) + require.NoError(t, err) + + require.Equal(t, 2, len(m)) + require.Equal(t, 1, len(m["foo"].Outputs)) + require.Equal(t, []string{"type=local,dest=out"}, m["foo"].Outputs) + require.Equal(t, 1, len(m["bar"].Outputs)) + require.Equal(t, []string{"type=image,push=true"}, m["bar"].Outputs) } func TestReadTargetsCompose(t *testing.T) { diff --git a/commands/bake.go b/commands/bake.go index 9b3ee5c9daeb..14e3d4a3394b 100644 --- a/commands/bake.go +++ b/commands/bake.go @@ -72,7 +72,7 @@ func runBake(ctx context.Context, dockerCli command.Cli, targets []string, in ba overrides := in.overrides if in.exportPush { - overrides = append(overrides, "*.output=type=registry") + overrides = append(overrides, "*.push=true") } if in.exportLoad { overrides = append(overrides, "*.output=type=docker")