I am aware that I can limit the resources allocated to a container while provisioning using docker with the -c
and -m
flags for CPU and memory.
However, is there a way I can change these allocated resources to containers dynamically (after they have been provisioned) and without redeploying the same container with changed resources?
At the time (Docker v1.11.1) has the command
docker update
(view docs). With this you can change allocated resources on the fly.not at present no - There is a desire to see someone implement it though: https://github.com/docker/docker/issues/6323
That could be coming for docker 1.10 or 1.11 (Q1 2016): PR 15078 is implementing (Dec. 2015) support for changing resources (including CPU) both for stopped and running container.
Update 2016: it is part of docker 1.10 and documented in
docker update
(PR 15078).Note that making changes via
docker set
should persist.I.e., those changes would be permanent (updated in the container's JSON)