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

纵然是瞬间 提交于 2019-11-30 12:35:16

问题


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 powerful specs, but I would have thought I should be able to run Docker?

However, having downloaded Docker, I get the error message:

Not Enough memory to start docker

I have seen various forum posts and github issues about this and followed all the advice I can see, such as modifying the settings in Docker, I tried these:

They also mentioned changing the settings of the Hyper-V VM however, this seems to be deleted and recreated with the Docker specified settings on every attempted launch. I tried 2048MB, 1792MB, 1536MB, 1280MB and 1024MB of RAM, all of which failed.

What else can I do? Surely I can run docker in some form on my machine? NB: I have closed all non-essential background apps. There doesn't seem to be many other suggestions for what seems to be a fairly common issue, where the given solutions don't work?


回答1:


I have also encountered the same problem. Tried everything from giving dynamic memory to enabling and disabling Hyper V and many more. But with all that, I got no success.

Then I tried these steps for

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

1) From System Tray menu, right click on Docker icon

2) Select Switch to Windows containers...

3) Restart the system.

There you go after restarting your docker status should be showing as: Docker is running

Hope this helps!

PS: Switching back to Linux container should work now after switching to Windows Containers for most of the users as said by rfay.


Updates (May 01, 2019)

Despite of the above methods if you're still unable to start docker on your Windows Machine, try with the following things:

  • Download RAMMap from Microsoft's Official website
  • Open the application and select Empty menu
  • From the sub-menu list select the first option Empty Working Sets
  • Now refresh it by pressing F5

Now try running docker and I believe this should work. Good Luck!




回答2:


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 :)




回答3:


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




回答4:


It is not the problem of RAM. It is the allocated disk memory to docker.
It means there is not enough space for docker to create an image or any other docker related operations.

Open the docker settings >> advanced >> disk image max size

Increase this size and apply the changes.

It will restart automatically and then you're good to go.




回答5:


if you are on window and got this error, Go to Search box

#1 type Hyper-V Manager 
 Click on it,
 a window like attached screenshot open,

#2 Select  MobilinuxVM(normally same name if running windows docker)
#3 Right click and open - Setting 
    2 The second window will open(setting for MobiLinux) i.e to the screenshot.
#4 Go to Memory Tab in left Pane.
#5 click on a dynamic checkbox and set minimum value to some lower amount say 512, and max value to the desired one,
#6 apply 
now it will start running as well after few minutes take the amount it required as well.



回答6:


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.




回答7:


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




回答8:


When I experienced this problem I modified the PowerShell script MobyLinux.ps1 found in the resources folder on the Docker install in C:\Program Files\Docker\Docker\resources. Essentially I forced the values for the $CPUs to 2 and the $Memory to 512, which worked for my dev box's limited resources!

At this point when Docker drops the MobyLinuxVM instance in Hyper-V and re-creates it from the PowerShell script it now uses my values:

This time the VM remains up and stable, and Docker successfully switches from the Windows Containers to the Linux Containers:

Hope this helps someone.




回答9:


I lowered my memory and swap to the lowest it would go as well as the disk image size to 32gb and it finally started without switching to windows containers or having to reboot.




回答10:


Problem: Installed Docker Desktop. Got Out of Memory error upon starting with linux instance.

Details: OS: Windows 10 Professional Host: Lenovo ThinkPad Carbon X1, 4GB RAM Docker Desktop: Version 2.1.0.1 (37199) Docker advanced settings:

  • CPUs: 2
  • Memory: 2048MB (this is the maximum)
  • Swap: 2048MB
  • Disk Image Size: 59.6GB (4MB used)

Hyper-V settings for DockerDesktopVM:

  • Settings > Memory > RAM: 2048MB (tried to increase to 4096; still doesn't work)
  • Settings > Memory > Enable Dynamic Memory (checked/un-checked; both doesn't work)

Under variations of the above settings, Docker Desktop gives this error when starting/ re-starting:

Not enough memory to start Docker Desktop You are trying to start Docker Desktop but you don't have enough memory. Free some memory or change your settings.

The problem resolutions reported in the following links, e.g. starting with Windows instance, then switching back to Linux, don't work for me, regardless of how much memory I allocate via Hyper-V or Docker settings.

It is utterly frustrating because apparently people are reporting being able to start with linux instances on host machines with 4GB of RAM. So I wonder what I am doing wrong.

Resources researched/ tried:

  • https://forums.docker.com/t/not-enough-memory-to-start-docker/13512/24
  • Docker won't start on Windows: Not Enough memory to start docker

Questions:

  1. Can I even run Docker Desktop with linux instance on my host machine?
  2. If (1) is yes, then what settings will allow me to do this?



回答11:


Issue resolved after just restarting the PC -_-. Dont know what is that.



来源:https://stackoverflow.com/questions/43170089/docker-wont-start-on-windows-not-enough-memory-to-start-docker

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!