Add ability to set cgroup parent for all containers

Fix #18022

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 2e3186ab065a7130a6e6267d86750848d5eb7d80
Component: engine
This commit is contained in:
Alexander Morozov
2015-12-07 09:55:33 -08:00
committed by Anusha Ragunathan
parent 89d18d78c9
commit 0c89fbf389
5 changed files with 56 additions and 1 deletions

View File

@ -20,6 +20,7 @@ weight = -1
--authz-plugin=[] Set authorization plugins to load
-b, --bridge="" Attach containers to a network bridge
--bip="" Specify network bridge IP
--cgroup-parent=/docker Set parent cgroup for all containers
-D, --debug Enable debug mode
--default-gateway="" Container default gateway IPv4 address
--default-gateway-v6="" Container default gateway IPv6 address
@ -643,4 +644,20 @@ set like this:
/usr/local/bin/docker daemon -D -g /var/lib/docker -H unix:// > /var/lib/docker-machine/docker.log 2>&1
# Default cgroup parent
The `--cgroup-parent` option allows you to set the default cgroup parent
to use for containers. If this option is not set, it defaults to `/docker`.
If the cgroup has a leading forward slash (`/`), the cgroup is created
under the root cgroup, otherwise the cgroup is created under the daemon
cgroup.
Assuming the daemon is running in cgroup `daemoncgroup`,
`--cgroup-parent=/foobar` creates a cgroup in
`/sys/fs/cgroup/memory/foobar`, wheras using `--cgroup-parent=foobar`
creates the cgroup in `/sys/fs/cgroup/memory/daemoncgroup/foobar`
This setting can also be set per container, using the `--cgroup-parent`
option on `docker create` and `docker run`, and takes precedence over
the `--cgroup-parent` option on the daemon.