Browse code

Merge pull request #47563 from vvoland/buildkit-runc-override

builder-next: Add env-var to override runc used by buildkit

Sebastiaan van Stijn authored on 2024/03/15 04:17:01
Showing 1 changed files
... ...
@@ -57,9 +57,16 @@ func newExecutor(root, cgroupParent string, net *libnetwork.Controller, dnsConfi
57 57
 		return nil, err
58 58
 	}
59 59
 
60
+	runcCmds := []string{"runc"}
61
+
62
+	// TODO: FIXME: testing env var, replace with something better or remove in a major version or two
63
+	if runcOverride := os.Getenv("DOCKER_BUILDKIT_RUNC_COMMAND"); runcOverride != "" {
64
+		runcCmds = []string{runcOverride}
65
+	}
66
+
60 67
 	return runcexecutor.New(runcexecutor.Opt{
61 68
 		Root:                filepath.Join(root, "executor"),
62
-		CommandCandidates:   []string{"runc"},
69
+		CommandCandidates:   runcCmds,
63 70
 		DefaultCgroupParent: cgroupParent,
64 71
 		Rootless:            rootless,
65 72
 		NoPivot:             os.Getenv("DOCKER_RAMDISK") != "",