Replacement for Docker Desktop on Windows?

Folks, I have a node.js script running on my Windows machine that uses the dockerode npm package to talk to docker on said box and starts and kills docker containers.

However, after the containers have been killed off, docker still holds on to the memory that it blocked for those containers and this means downstream processes fail due to lack of RAM.

To counter this, I have powershell scripts to start docker desktop and to kill docker desktop.

All of this is a horrid experience.

On my Mac, I just use Colima with Portainer and couldn’t be happier.

I’ve explored some options to replace Docker Desktop and it seems Rancher Desktop is a drop-in replacement for Docker Desktop, including the docker remote API.

  1. Is this true? Is Rancher Desktop that good of a drop-in replacement?
  2. Does Rancher Desktop better manage RAM for containers that have been killed off? Or does it do the same thing as Docker Desktop and hold on to the RAM?

Are there other options which I’m not thinking of which might solve my problems? I’ve seen a few alternatives but haven’t tried them yet - moby,
containerd,
podman

I don’t actually need the Docker Desktop interface. So pure CLI docker would also just work. How are you all running pure docker on Windows boxes?

i_am_not_a_robot,

First, it’s not possible to use “pure docker” on Windows. Docker is for running additional user mode environments under the same kernel. You can’t run Linux applications under the Windows kernel without WSL1, and WSL1’s Linux implementation does not support the features required for Docker. This is also possible in limited cases with Windows Server, but because of differences in the way Windows works you almost always end up running a second kernel.

WSL2 can be used to run Docker, and in fact that’s how Docker Desktop works since years ago. When you start Docker Desktop it starts a WSL2 distribution under which the containers run. Running Docker from the command line only will not positively change the performance of your containers.

Running other virtualization software, especially VirtualBox, to start a separate Linux VM and running your containers in there is going to be more complicated and give worse performance unless you disable all virtualization-based features of Windows, such as WSL2 and security isolation.

The solution to your memory problem is most likely one of the following:

  1. Don’t disable the pagefile. Windows uses a weird memory model where all virtual memory must be backed by physical memory. Certain software will allocate virtual memory without using it, and Windows will require that the sum of the physical memory size and the page file size be adequate to use all of that virtual memory. Disabling the pagefile or limiting it to small sizes because you “have enough RAM” will cause out of memory errors while you still have plenty of RAM available.
  2. Reduce the amount of memory that Docker is allowed to use to a level that your Windows software can tolerate. You may need to switch Docker Desktop to Hyper-V mode for this option to be available, which isn’t an option if you’re on Windows Home, and this may reduce compatibility.
  3. After stopping your containers, run echo 1 > /proc/sys/vm/compact_memory at a WSL2 prompt or wsl -u root – bash -c ‘echo 1 > /proc/sys/vm/compact_memory’ from a Windows prompt. See Memory Reclaim in the Windows Subsystem for Linux 2 for details about what this does.
Zeth0s,

Wsl2 and podman.

Far from a nice overall experience compared to using docker on a real OS, but the best I could get on windows

nickwitha_k,

If you don’t need UI, I prefer Podman. Rancher Desktop is good though.

damnthefilibuster,

thanks! So podman supports the docker API completely?

frankivo,

Drop-in replacement as far as I can tell after using it for some time

russjr08,
@russjr08@outpost.zeuslink.net avatar

Yep! You can even just alias the docker command to podman, and most things will work just fine. Podman can also expose a socket that is compatible with the Docker API for anything that requires it too.

TrustingZebra,

This is a common misconception. Podman has similar commands to Docker CLI but it’s not a “drop-in replacement”. Depending on your usage, you might run into things that don’t work the same.

frankivo,

Interesting, thanks!

eight_byte,

When I had a look on it a while ago they didn’t support Docker Compose. But except this it’s a drop in replacement.

rootusercyclone,

There’s now github.com/containers/podman-compose which seems to work okay, haven’t tested heavily though

marty,

Yes, rancher desktop works perfectly 👍🏻

loren,

Podman Desktop is also a thing

rikudou,
@rikudou@lemmings.world avatar

When I had Windows I ran WSL2 + standard Linux docker, worked flawlessly. If you have all your files in the WSL volume, it’s also really fast compared to Docker Desktop on Windows or Mac. I found it almost as fast as a native Linux version.

damnthefilibuster,

I thought WSL2 made things slow because of some stupidity they did with the code? Maybe they fixed it.

Anyways, is it able to take as much resources as it needs from the host? Unrestricted in terms of RAM and CPU?

breadsmasher,
@breadsmasher@lemmy.world avatar

made things slow

That’s probably referring to how file systems are handled. Going from WSL to windows file system is slower than using the “proper” mount point

Unrestricted

yes

damnthefilibuster,

nice! Thanks! :)

rikudou,
@rikudou@lemmings.world avatar

It’s slow when you go cross-filesystem, meaning accessing WSL2 files from Windows, or accessing Windows files from WSL2. If you keep all related files in WSL2, it’s really comparable to native Linux experience (with a small penalty due to being ran in a VM, but it’s not noticeable by a human eye).

As far as I know, yes, it can take all the resources it needs.

theterrasque,

is it able to take as much resources as it needs from the host? Unrestricted in terms of RAM and CPU?

learn.microsoft.com/en-us/windows/wsl/wsl-config#…

princessnorah,
@princessnorah@lemmy.blahaj.zone avatar

This is what I do as well. I generally use it for testing then deploy it on my home server in a linux VM.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • uselessserver093
  • Food
  • aaaaaaacccccccce
  • [email protected]
  • test
  • CafeMeta
  • testmag
  • MUD
  • RhythmGameZone
  • RSS
  • dabs
  • Socialism
  • KbinCafe
  • TheResearchGuardian
  • oklahoma
  • feritale
  • SuperSentai
  • KamenRider
  • All magazines