summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--runsc/container/container.go4
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)