Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set Docker's system memory?

Tags:

docker

macos

I'm using Docker 1.13.1 for Mac. The Docker client allows you to change the amount of memory provided to Docker using a simple slider interface.

How can I set this value via docker's command line utility?

For added clarity, this is not per container memory, this is the value of "Total Memory" that's returned when you run docker info.

Thank you

like image 872
Billy Blob Snortin Avatar asked Oct 18 '25 14:10

Billy Blob Snortin


1 Answers

With docker (at least version 18.03.1) the settings for the VM are maintained in a special file located at:

/Users/<username>/Library/Group\ Containers/group.com.docker/settings.json

If you close docker you can edit it directly from the command line using sed, for example the command below will replace the 2 GB limit with a 10GB limit, and create a backup file of the original settings at settings.json.bak

sed -i .bak 's/2048/10240/g' /Users/`id -un`/Library/Group\ Containers/group.com.docker/settings.json

When docker restarts, it will now have 10 GB.

like image 173
evolvedmicrobe Avatar answered Oct 20 '25 04:10

evolvedmicrobe



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!