How to reduce default VM memory for Docker Linux containers on Windows

后端 未结 1 1758
被撕碎了的回忆
被撕碎了的回忆 2021-02-04 16:23

Scenario

  • Windows 10 Professional
  • Docker 18.06.1-ce running in Windows container mode
  • 4GB of available memory on host system
  • using Hype
1条回答
  •  有刺的猬
    2021-02-04 17:17

    After some searching I found out that settings of Docker's user interface are stored in %APPDATA%\Docker\settings.json (e.g. C:\Users\olly\AppData\Roaming\Docker), memory settings are defined in memoryMiB property.

    The following solved the problem on my environement:

    • quit Docker
    • modify settings.json file using notepad %APPDATA%\Docker\settings.json in the run command prompt (Windows-Key + R)
    • adjust value memoryMiB to 1024 (has been 2048 before)
      • in Docker versions 19.x and later the property is called memoryMiB
      • in Docker versions 18.x and before the property was called VmMemory
    • save settings.json
    • start Docker and finally being able to use "switch to Linux containers"

    Property memoryMiB in Docker versions 19.x and later

    Property VmMemory in Docker versions 18.x and before

    0 讨论(0)
提交回复
热议问题