diff --git a/build/localstate.go b/build/localstate.go index f6bd1f71..1c8f51e9 100644 --- a/build/localstate.go +++ b/build/localstate.go @@ -11,7 +11,7 @@ import ( func saveLocalState(so *client.SolveOpt, target string, opts Options, node builder.Node, cfg *confutil.Config) error { var err error - if so.Ref == "" { + if so.Ref == "" || opts.CallFunc != nil { return nil } lp := opts.Inputs.ContextPath diff --git a/commands/bake.go b/commands/bake.go index d5105df8..95fdcea5 100644 --- a/commands/bake.go +++ b/commands/bake.go @@ -464,12 +464,18 @@ func saveLocalStateGroup(dockerCli command.Cli, in bakeOptions, targets []string groupRef := identity.NewID() refs := make([]string, 0, len(bo)) for k, b := range bo { + if b.CallFunc != nil { + continue + } b.Ref = identity.NewID() b.GroupRef = groupRef b.ProvenanceResponseMode = prm refs = append(refs, b.Ref) bo[k] = b } + if len(refs) == 0 { + return nil + } l, err := localstate.New(confutil.NewConfig(dockerCli)) if err != nil { return err