diff options
author | Konstantin Baranov <konstantin.baranov@workato.com> | 2020-09-15 20:50:07 -0700 |
---|---|---|
committer | Konstantin Baranov <konstantin.baranov@workato.com> | 2020-09-15 20:50:07 -0700 |
commit | b8dc9a889f3d945bcd0f02f8ca34eb2e579e8b0e (patch) | |
tree | 0554d7f91042eadd06e9e18aff9f0876f8d863a0 /runsc/container/container.go | |
parent | 3fd4b83fa325de5e4e49c6fdcaa95a1a3db486ed (diff) |
Use container ID as cgroup name if not provided
Useful when you want to run multiple containers with the same config.
And runc does that too.
Diffstat (limited to 'runsc/container/container.go')
-rw-r--r-- | runsc/container/container.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/runsc/container/container.go b/runsc/container/container.go index 7ad09bf23..15c445754 100644 --- a/runsc/container/container.go +++ b/runsc/container/container.go @@ -311,6 +311,10 @@ func New(conf *boot.Config, args Args) (*Container, error) { if isRoot(args.Spec) { log.Debugf("Creating new sandbox for container %q", args.ID) + if args.Spec.Linux != nil && args.Spec.Linux.CgroupsPath == "" { + args.Spec.Linux.CgroupsPath = "/" + args.ID + } + // Create and join cgroup before processes are created to ensure they are // part of the cgroup from the start (and all their children processes). cg, err := cgroup.New(args.Spec) |