The docker update command dynamically updates container configuration like cpu, memory etc.
To specify more than one container, provide space-separated list of container names or IDs.
root@ip-172-31-28-155:/home/ubuntu# docker stats | egrep "CONTAINER|anoop_ubuntu_mem"
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
ae8459944595 anoop_ubuntu_mem 0.00% 3.781MiB / <strong><span class="has-inline-color has-primary-color">2GiB</span></strong> 0.18% 1.23kB / 0B 0B / 0B 3
root@ip-172-31-28-155:/home/ubuntu# <strong><span class="has-inline-color has-primary-color">docker update --memory "5g" ae8459944595</span></strong>
ae8459944595
Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap.
root@ip-172-31-28-155:/home/ubuntu# docker stats | egrep "CONTAINER|anoop_ubuntu_mem"
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
ae8459944595 anoop_ubuntu_mem 0.00% 3.781MiB /<strong> </strong><span class="has-inline-color has-primary-color"><strong>5GiB</strong> </span>0.07% 1.23kB / 0B 0B / 0B 3Code language: HTML, XML (xml)