Docker won't start on Windows: Not Enough memory to start docker

后端 未结 18 2087
[愿得一人]
[愿得一人] 2020-12-12 22:07

I am trying to get started with Docker on Windows. My machine has 4GB of RAM and a 1.9GHz - 2.5GHz Intel i5 processor, running Windows 10 Pro x64. I know these aren\'t power

相关标签:
18条回答
  • 2020-12-12 22:27

    Have you enabled NUMA spanning in your HyperV settings? if not enable it i bet that will solve your issue.

    By default, Windows Server enables NUMA spanning, which provides the most flexibility as virtual machines (VMs) can access and use memory in any NUMA node. But it may result in lower performance compared to forcing VMs to use memory on the same NUMA node as the processor cores.

    By disabling NUMA spanning, you ensure that VMs use memory and processor cores in the same NUMA node, giving the best performance. This should only be changed once, if, as an administrator, you feel comfortable with NUMA and the implications of disabling and also if you have some additional management suite that can help ensure best configuration.

    To configure NUMA spanning, open the Hyper-V Settings and select the NUMA Spanning option and disable it, I am sure, it will get solved; I struggled with the issue for a week and resolved it by disabling NUMA.

    I am sure this would be marked as resolved by disabling NUMA in Hyper-V Manager.

    0 讨论(0)
  • 2020-12-12 22:28

    I solved this issue by right clicking on the docker tray icon chose settings and then tapped on the "Advanced" section.

    Then I lowered the memory from the default 2048 to 1536 and works like charm. Another option is try to switch to Windows Containers then Restart the Machine and switch back to Linux Containers.

    Below is my docker settings with Advanced tab open. Note the Memory is 1536 and My laptop has 4GB Ram.

    Also the virtual machine "MobyLinuxVM" is running as shown below;

    I hope this helps someone one day even if was a late answer :)

    0 讨论(0)
  • 2020-12-12 22:30

    So to begin with I normally start off with opening Visual Studio Code then my terminal and finally Docker Desktop WSL2. The problem being is that Visual Studio Code is a chunky memory hogger and initially requires a lot of memory to run. Especially if you used the integrated terminal, multiple tabs, and ultimately multiple windows.

    When I open Docker Desktop last it gives me not enough resources error. After a little messing and testing, I found out that Docker initially needs to load first because it needs to obtain a certain amount of memory for your containers and images to run. So starting Docker Desktop manually, not on windows startup, then your other programs and tools should, I am saying should as everyone's environment and problems are different from mine and I am not expecting them to be the same, work fine.

    So here are the steps:

    1. On opening your computer, mine is Windows 10 using WSL2 with Home, do not immediately have Docker open on startup. Instead, run the program manually by double-clicking the icon or searching in your start menu and clicking on Docker Desktop.
    2. Next, we then want to open Windows Visual Studio Code and other programs after that.
    3. Before running any commands, as I do run them through node js with specific package.json defined commands, check docker desktop as sometimes your containers and images are already running and therefore shouldn't need to run any commands to bring them up again.

    If all this fails try going into your settings and allocating specific memory. Check your task manager processes and see what is taking up all of your resources. I hope this helps. Again everyone's environment is not the same so do not expect similar results as I have had. This SHOULD work doesn't mean it will. Read the documentation as well as it does help with identifying problems faster.

    0 讨论(0)
  • 2020-12-12 22:34

    I have also the same problem. Maybe you have other virtual machine in Hyper-v, other Virtual machin need memory too. please stop all other Hyper-v Virtual machine and test again. for me worked My Hyper-v Manager

    0 讨论(0)
  • 2020-12-12 22:36

    This may happen because the ram is not free at the time you starting docker

    I had opened 20 tabs of the browser, that leads to no free ram so I closed all the tabs refresh the computer several times, and tried restarting once again and it works for me

    0 讨论(0)
  • 2020-12-12 22:37

    In Settings, I did a reset to factory defaults. And restarted the laptop. It Worked for me

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