Skip to content

Commit

Permalink
Merge pull request docker#2754 from crazy-max/call-localstate
Browse files Browse the repository at this point in the history
build: don't generate local state for subrequests
  • Loading branch information
tonistiigi authored Oct 25, 2024
2 parents 658ed58 + 886ae21 commit 2bdf451
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build/localstate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions commands/bake.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2bdf451

Please sign in to comment.