docker/libcontainer — pull request #15 by alexlarsson (2014-06-13 10:53:20+00:00)
Title: Mount cgroup in container

We make a tmpfs on /sys/fs/cgroups, and here we mount read-only versions of all the host cgroups. Additionally we make symlinks for all merged subsystems.

For any "named" cgroup, such as "name=systemd" we also mount the subset of the cgroup where the container lives as read-write. This means that the container can create sub-cgroups inside the container and move tasks into those, but it can never escape from its current position in the cgroup hierarchy.

In particular, this (and some other changes, like having a /run in the container) allows systemd to work in the container.