Memory/CPU
Docker now supports more resource allocation options:
- CPU shares, via -c flag
- Memory limit, via -m flag
- Specific CPU cores, via –cpuset flag
Have a look at docker run --help for more details.
If you use lxc backend (docker -d --exec-driver=lxc), more fine grained resource allocation schemes can be specified, e.g.:
docker run --lxc-conf="lxc.cgroup.cpuset.cpus = 0,1"\
--lxc-conf="lxc.cgroup.cpu.shares = 1234"
Storage
Limiting storage is a bit trickier at the moment. Please refer to the following links for more details:
- Resizing Docker containers with the Device Mapper plugin
- Question on Resource Limits?
- devicemapper – a storage backend based on Device Mapper