Live data from Hacker News

Docker on MacOS is slow and how to fix it

paolomainardi.com

51–60 of 211 posts

Re: Docker on MacOS is slow and how to fix it

#51
post #19

Earlier quoted context omitted.

My preferred fix: don't develop in Mac.

For many Mac is the only sensible option. There's one developer in our company that uses Linux and it's a lot of pain to setup. Mac has the best balance between coding, utility tools and "other work stuff". Windows probably on par if not more for "work stuff" but falls badly in the coding & tooling department. Linux is OK ish for coding and utility but falls behind for "other work stuff" and certainly a pain to just…

> There's one developer in our company that uses Linux and it's a lot of pain to setup.

There was one developer in our team using Mac. Everyone (>20 people) else were using Linux. Mac was a lot of pain to setup.

Linux is the best balance between coding, utility tools and "other work stuff".

Windows is not even considered for development, it falls badly in the coding & tooling department.

So in our company almost every dev uses Linux (except this one hipster using Mac) & marketing team use Windows

Re: Docker on MacOS is slow and how to fix it

#52
> We had to abandon Docker because we had folks with macOS on the team. But, other tasks (email, conference calling, scanning, word, upgrading without breakage) came with more friction, and those tend to fill up ever larger shares of my day.

source: https://kvz.io/macos-install.html

Re: Docker on MacOS is slow and how to fix it

#53
post #41

Earlier quoted context omitted.

For many Mac is the only sensible option. There's one developer in our company that uses Linux and it's a lot of pain to setup. Mac has the best balance between coding, utility tools and "other work stuff". Windows probably on par if not more for "work stuff" but falls badly in the coding & tooling department. Linux is OK ish for coding and utility but falls behind for "other work stuff" and certainly a pain to just…

> everyone in the development & support team uses Mac (except this one guy who insisted in Linux), > certainly a pain to just keep it updated. > Linux and it's a lot of pain to setup. If you're not using Linux, how are you justifying these claims? > certainly a pain to just keep it updated. Excluding the boot time for both, MacOS takes between 15 and 45min to update. Linux is a few seconds. I suspect that the only OS…

How do I get my laptop to properly sleep when using Linux?

Re: Docker on MacOS is slow and how to fix it

#54
post #41

Earlier quoted context omitted.

For many Mac is the only sensible option. There's one developer in our company that uses Linux and it's a lot of pain to setup. Mac has the best balance between coding, utility tools and "other work stuff". Windows probably on par if not more for "work stuff" but falls badly in the coding & tooling department. Linux is OK ish for coding and utility but falls behind for "other work stuff" and certainly a pain to just…

> everyone in the development & support team uses Mac (except this one guy who insisted in Linux), > certainly a pain to just keep it updated. > Linux and it's a lot of pain to setup. If you're not using Linux, how are you justifying these claims? > certainly a pain to just keep it updated. Excluding the boot time for both, MacOS takes between 15 and 45min to update. Linux is a few seconds. I suspect that the only OS…

My read on it was that this person heard what their coworker has to go through, and has formed an opinion based on that. I understand that climbing Mt. Everest is fairly difficult, despite not having done it myself.

Re: Docker on MacOS is slow and how to fix it

#55
I have Apple Silicon but develop on docker x86. The game changer for me was macOS Ventura with rosetta support for linux vms.

I use UTM to run Debian 11 ARM. The update-binfmts command is absolutely magical, docker images will happily run both arm and x86 binaries.

Battery lasts all day and the machine stays ice-cold.

https://docs.getutm.app/advanced/rosetta/

Re: Docker on MacOS is slow and how to fix it

#57
My preferred fix: pay for a Parallels Pro license and run Ubuntu on a VM, then run docker there. The VM is configured to start on login and run in the background.

I have the Remote SSH plugin set up in VSCode, a `vmlogin` alias set up in bash, and all container ports forwarded in the VM's config.

Re: Docker on MacOS is slow and how to fix it

#58
post #47
post #42

Docker is cripplingly slow on MacOS. I have a maxed out 16" mbp... starting rspec on our app takes 55-60 seconds. Compare that to my coworkers on Linux and Windows, who both see sub 10 second boots, and it's absolutely impossible to be ok with those numbers.

this is very true. not to mention it's very slow on its networking... i've given up docker on macOS long ago. If I was to use docker, I'll switch to my debian laptop. way much much faster.

Happy to give up Docker, but still using MacOS as a daily driver?

Re: Docker on MacOS is slow and how to fix it

#59

What sort of workloads are people doing where the filesystem access is limiting them? I develop python web apps on a mac and use dockerized postgres and a dockerized flask app. I don't seem to experience any noticeable issues. When I am developing I mount the source code directory as a volume so code edits are synced live into the running docker container. I also develop frontends using vue, managed by npm. In my exp…

Mentioned in the article, node packages that create tens of thousands, sometimes hundreds of thousands of files.

Re: Docker on MacOS is slow and how to fix it

#60
Funny that this came up — shameless plug: I've actually been working on a new Linux+Docker+Kubernetes solution for macOS recently! Already added quite a few improvements over existing apps including Docker Desktop, Rancher, Colima, etc:

- Fast networking: 30 Gbps! vs. 150 Mbps with Docker VPNKit. Full VPN compatibility, IPv6, ping, ICMP and UDP traceroute, and half-open TCP connections.

- Bidirectional filesystem sharing: fast VirtioFS to access macOS from Linux, but also a mount to access the Linux filesystem from macOS. This setup can help with performance: for example, you could store code in Linux and edit it from macOS with VS Code (which can take the performance hit of sharing), so the container runs with native FS speed.

- Not limited to Docker or Kubernetes. You can run multiple full Linux distros as system containers (like WSL) so they share resources.

- Fast x86 emulation with Rosetta

- Much lower background CPU usage. Only ~0.05% CPU usage and 2-5 idle wakeups per second — less than most apps, while Docker wakes up ~120 times per second. Made possible with low-level kernel optimizations. Also, no Electron!

- Better solutions to other problems that can occur on macOS: clock drift is corrected monotonically, dynamic disk size, and more I'm working on now. Will look into memory usage too, although I can't guarantee a good fix for that.

- No root needed.

Planning to release this as a paid app in January. Not OSS, but I think the value proposition is pretty good and there will be a free trial. Not sure about pricing yet.

If anyone is interested, drop me an email (see bio) and I'll let you know when this is ready for testing :)

Also, feel free to ask questions here or let me know if there are other warts you'd like to see fixed.

Post reply on HN