diff --git a/build/build.go b/build/build.go index 25d19ef8..83a76603 100644 --- a/build/build.go +++ b/build/build.go @@ -285,7 +285,7 @@ func isDefaultMobyDriver(d driver.Driver) bool { func toSolveOpt(d driver.Driver, multiDriver bool, opt Options, dl dockerLoadCallback) (solveOpt *client.SolveOpt, release func(), err error) { defers := make([]func(), 0, 2) - release = func() { + releaseF := func() { for _, f := range defers { f() } @@ -293,7 +293,7 @@ func toSolveOpt(d driver.Driver, multiDriver bool, opt Options, dl dockerLoadCal defer func() { if err != nil { - release() + releaseF() } }() @@ -466,7 +466,7 @@ func toSolveOpt(d driver.Driver, multiDriver bool, opt Options, dl dockerLoadCal } so.FrontendAttrs["add-hosts"] = extraHosts - return &so, release, nil + return &so, releaseF, nil } func Build(ctx context.Context, drivers []DriverInfo, opt map[string]Options, docker DockerAPI, auth Auth, pw progress.Writer) (resp map[string]*client.SolveResponse, err error) { diff --git a/driver/driver.go b/driver/driver.go index 2aa114ea..a9faf799 100644 --- a/driver/driver.go +++ b/driver/driver.go @@ -72,7 +72,7 @@ func Boot(ctx context.Context, d Driver, pw progress.Writer) (*client.Client, er } } - c, err := d.Client(ctx) + c, err := d.Client(context.TODO()) if err != nil { if errors.Cause(err) == ErrNotRunning && try <= 2 { continue