docker-container: support --driver-opt cgroup-parent=...

This allows the parent cgroup to be customised, which allows resource
limits to be imposed on build containers separately from "user"
containers.

Signed-off-by: David Scott <dave@recoil.org>
This commit is contained in:
David Scott
2021-09-27 17:10:00 +01:00
parent c643c2ca95
commit b5bc754bad
3 changed files with 13 additions and 4 deletions

View File

@ -49,6 +49,8 @@ func (f *factory) New(ctx context.Context, cfg driver.InitConfig) (driver.Driver
}
case k == "image":
d.image = v
case k == "cgroup-parent":
d.cgroupParent = v
case strings.HasPrefix(k, "env."):
envName := strings.TrimPrefix(k, "env.")
if envName == "" {