From 0f09e2ecfe0a4843fe83db3e436904cd56c9e3c6 Mon Sep 17 00:00:00 2001 From: Tonis Tiigi Date: Thu, 4 Feb 2021 22:45:20 -0800 Subject: [PATCH] don't require entitlement for network none Signed-off-by: Tonis Tiigi --- build/build.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build/build.go b/build/build.go index f418029d..ea38cf55 100644 --- a/build/build.go +++ b/build/build.go @@ -465,9 +465,11 @@ func toSolveOpt(ctx context.Context, d driver.Driver, multiDriver bool, opt Opti // setup networkmode switch opt.NetworkMode { - case "host", "none": + case "host": so.FrontendAttrs["force-network-mode"] = opt.NetworkMode so.AllowedEntitlements = append(so.AllowedEntitlements, entitlements.EntitlementNetworkHost) + case "none": + so.FrontendAttrs["force-network-mode"] = opt.NetworkMode case "", "default": default: return nil, nil, errors.Errorf("network mode %q not supported by buildkit", opt.NetworkMode)