rootless: mount /sys/fs/cgroup/systemd from the host

systemd requires /sys/fs/cgroup/systemd to be writeable.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano 2018-11-05 22:48:29 +01:00
parent 11c5b0237b
commit f813881b81
No known key found for this signature in database
GPG key ID: E4730F97F60286ED

View file

@ -376,6 +376,14 @@ func (c *Container) setupSystemd(mounts []spec.Mount, g generate.Generator) erro
Options: []string{"bind", "private"},
}
g.AddMount(systemdMnt)
} else {
systemdMnt := spec.Mount{
Destination: "/sys/fs/cgroup/systemd",
Type: "bind",
Source: "/sys/fs/cgroup/systemd",
Options: []string{"bind", "nodev", "noexec", "nosuid"},
}
g.AddMount(systemdMnt)
}
return nil