Ask HN: Docker in WSL vs. Docker on MacBook M1?

2 points by kujin88 ↗ HN
Hi all,

Been developing in WSL2 for various things like Ruby/Rails, Elixir, Python, and even some Android development for quite some time. However, I came across the new Apple Silicon M1 Chip and heard a lot of positive things about it. I wanted to purchase a device for my side projects so trying to get some insight on what your experience has been on this "new" platform.

My work heavily involves Docker, and I have always known that OSX never had a good support for it. I tried Docker for Mac on intel many many times in the past and it always was painfully slow and not of much use.

People who have experience with Docker, and software development on the new M1 platform, can you comment on differences compared to WSL2? I really liked my experience with WSL2 and it has always been a breeze to have a Linux machine live right in my Windows.

Thank you!

15 comments

[ 3.7 ms ] story [ 41.6 ms ] thread
Just like in Windows and WSL2, Docker support in MacOS relies on a virtual machine running somewhere there. It probably works fine for most things since Apple Silicon has been out for more than a year already and there's plenty of demand for this. The whole experience is 2nd rate on both of these platforms compared to how it would be on Linux.
Would you say OSX is worse than WSL though?
For Docker, they are about equally as bad. MacOS has the upper hand otherwise, as many unixy things work on it natively.
I'm the first to say Linux isn't an option, but why aren't you using Linux if your core work involves it? Just bite the bullet and be happier and more productive.

WSL is not up to snuff, frankly. Nor is MacOS.

Well I cannot use Linux as my main OS because of compatibility problems for some software and drivers I use. That said, I'm positive about Asahi. Not sure how long it will take to be ready
What software and drivers?
Photoshop is one example, and Adobe Creative Cloud as well.
Virtualbox is your friend. There are more expensive options. Use browser based products.
Docker on M1 is a pain in the ass if you have to focus on x86 instead of ARM. Non arm docker builds take much much longer to the point that my 2016 Mac is faster than my M1. But if you live in arm land it's fine. Unfortunately, that's not me so I spend most of my time Ssh'd into an x86 Linux machine.
"Ssh'd into an x86 Linux machine."

I would do that too, but I travel a lot as well, and this setup won't work well for me when I'm not home I guess :/

Probably 50$ server at Hetzner can be your friend here - 64gb ram with 2x512gb ssds on top of Ryzen
For Docker specifically, neither is worth the hassle IMO. Spend the extra money for an off-lease small form factor business PC, which are dirt cheap these days, run Linux and Docker on it and SSH into it as needed. The power cost is negligible, you aren't hobbled by trying to run both Docker and your normal apps on an anemic laptop CPU with limited RAM, and there are no oddball compatibility issues to have to deal with.
What do you say about WSL though? I am eyeing a machine that has 32 gigs of RAM and I guess it would be plenty for every container I wanted to run
The only real problem with WSL2 is networking. WSL2 for plain vm platform its more than usable for everything even desktop. I wish microsoft would make a dedicated gui like hyper-v/vmware to modify network/port/firewall settings.

Running virtualbox/vmware would be a better bet if you want to develop the same setup (docker host) you would use in lab/production and develop on your workstation. (gold copies, clone, terraform, whatever way you provision)

But if I really wanted a dedicated homelab for linux operating systems. I'd run vmware esxi (or even kvm) would be my choice. And you the free version of esxi is more than enough to get things done.

M1 is more for arm vm's, thou you could run parallels, it be slower, but you most likely dont need speed for docker, but you have to buy an M1 with more ram.

Myself, I've finally just ended up with vmware workstation on my win10 overkill workstation, and keep wsl for my quick tasks. I actually like win11, but I won't upgrade yet, android (asl) works fine. My M1 mac mini is a great general workstation, runs dual monitors, runs arm arch in a vm, easily the nicest cheap workstation out.