feat(buildkit): run buildkit container in net host to reach local kubernetes cluster

Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
This commit is contained in:
Tom Chauveau 2021-04-09 12:28:02 +02:00
parent 0f22f07c3f
commit 592cc040ca

View File

@ -104,9 +104,14 @@ func startBuildkit(ctx context.Context) error {
return err 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, cmd = exec.CommandContext(ctx,
"docker", "docker",
"run", "run",
"--net=host",
"-d", "-d",
"--restart", "always", "--restart", "always",
"-v", volumeName+":/var/lib/buildkit", "-v", volumeName+":/var/lib/buildkit",