DEV Community

Yogesh Galav
Yogesh Galav

Posted on

Docker is not suitable for windows.

I have 32 GB ram laptop with 11th Gen i5@2.9GHz (12 CPU), Still docker utilise all my cpu and overheats the system for just running mysql and phpmyadmin. The fan is running most of the time even when there is room temperature is low.

Is it fault of windows or docker or docker image that I'm using. It's kind of blockage I'm facing while doing development.

https://twitter.com/YogeshGalav7/status/1582671255513141248

Top comments (9)

Collapse
 
wmramadan profile image
Wael Ramadan

Do realize that docker is running virtualized on Windows vs Linux. On Linux it runs native unless you use Docker Desktop for Linux. On Windows it’s running virtualized weather you are running it in WSL or Windows!

Collapse
 
nricks profile image
nricks

it's there because you could potentially run windows containers on it (so, for giggles mostly)

my colleagues noticed a slight improvement after switching to wsl2 instead of having an actual vm managed by hyper-v, around a yr ago, though.

Collapse
 
yogeshgalav7 profile image
Yogesh Galav

I noticed both are installed on my system,
running cmd "wsl --list --verbose" shows docker-desktop and docker,
and also there are 6 services starting with hyper-v,
should I disable hyper-v?

Collapse
 
nricks profile image
nricks • Edited

learn.microsoft.com/en-us/windows/...

you need to make sure docker is on wls2, from the link above you should see some general info on wsl and a compare between wsl1 and wsl2.

I run docker on linux but just the engine without docker desktop, so I'm not sure where to look for the right options in the menus.

Anyways, they should be available for sure during docker desktop installation as a preference. So, I don't think it's about disabling virtualization system-wise, but rather about making sure your wls2 is correctly setup and your docker desktop install runs on it.

Collapse
 
bad_request400 profile image
Bad Request 400

Well it depends, do you use the WSL Integration?
I personally would also check the Ressource Allocation.
Because, especially in terms of RAM the service will take everything it can depending on what you set it to.

So if set to 8GB the Service will take ~8GB the moment it starts.

If you use the wsl integration you can set the Limits via an '.wslconfig' file in your User Dir.

Here's mine:

[wsl2]
memory=3GB # Limits VM memory in WSL 2 to 2 GB
processors=4 # Makes the WSL 2 VM use four virtual processors

Docker Desktop on Windows isnt the best but in combination with WSL its actually good enough imo.

So long

Collapse
 
yogeshgalav7 profile image
Yogesh Galav

Thanks for the processor info.

Collapse
 
obx88 profile image
Olivier Halupczok

Kinda off topic, but how do you handle with ports forwarding between WSL and your system? Docker was the reason why I switched to Ubuntu, cause working with that was hell, and one day it's just stopped working.

Collapse
 
yogeshgalav7 profile image
Yogesh Galav

I only know about port forwarding with docker-compose.yaml or docker run -p.

Collapse
 
volker_schukai profile image
Volker Schukai

Docker on windows has always been a drame for us. By the way, that was one of the reasons why we migrated to linux in development.