diff --git a/build/build.go b/build/build.go index 4143bc0d..a460e1b3 100644 --- a/build/build.go +++ b/build/build.go @@ -607,7 +607,9 @@ func toSolveOpt(ctx context.Context, node builder.Node, multiDriver bool, opt Op if err != nil { return nil, nil, err } - so.FrontendAttrs["add-hosts"] = extraHosts + if len(extraHosts) > 0 { + so.FrontendAttrs["add-hosts"] = extraHosts + } // setup shm size if opt.ShmSize.Value() > 0 {