From 592cc040ca57fb4bed0b2ca5ea5768d4f58a5fdc Mon Sep 17 00:00:00 2001 From: Tom Chauveau Date: Fri, 9 Apr 2021 12:28:02 +0200 Subject: [PATCH] feat(buildkit): run buildkit container in net host to reach local kubernetes cluster Signed-off-by: Tom Chauveau --- pkg/buildkitd/buildkitd.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/buildkitd/buildkitd.go b/pkg/buildkitd/buildkitd.go index f6effa61..386ffb0c 100644 --- a/pkg/buildkitd/buildkitd.go +++ b/pkg/buildkitd/buildkitd.go @@ -104,9 +104,14 @@ func startBuildkit(ctx context.Context) error { return err } + // FIXME: buildkitd currently runs without network isolation (--net=host) + // in order for containers to be able to reach localhost. + //This is required for things such as kubectl being able to + //reach a KinD/minikube cluster locally cmd = exec.CommandContext(ctx, "docker", "run", + "--net=host", "-d", "--restart", "always", "-v", volumeName+":/var/lib/buildkit",