Merge pull request #1457 from jedevc/add-hosts-length-check

build: don't set add-hosts option if empty
This commit is contained in:
Tõnis Tiigi 2022-12-08 19:48:09 -08:00 committed by GitHub
commit abc8121aa8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -624,7 +624,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 {