diff --git a/libcontainer/cgroups/utils.go b/libcontainer/cgroups/utils.go index 006800dcfae..51dc96429e3 100644 --- a/libcontainer/cgroups/utils.go +++ b/libcontainer/cgroups/utils.go @@ -145,6 +145,12 @@ func getCgroupMountsHelper(ss map[string]bool, mi io.Reader) ([]Mount, error) { if ss[opt] { m.Subsystems = append(m.Subsystems, opt) } + if strings.HasPrefix(opt, "nsroot=") { + nsroot := opt[7:] + if len(nsroot) > 1 && strings.HasPrefix(m.Root, nsroot) { + m.Root = m.Root[len(nsroot):] + } + } } res = append(res, m) }