Live data from Hacker News

Docker on MacOS is slow and how to fix it

paolomainardi.com

181–190 of 211 posts

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

#181
post #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 sha…

Docker VPNKit, fast VirtioFS, Much lower background CPU usage

Are there some new Linux drivers involved, or is this "just" a better tuned VM?

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

#182
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…

Seriously, of all the things you can say about linux, you need to mention that it's a pain to just keep it updated?

I am a .net developer and run Debian linux on my work laptop since ages. Keeping the OS and most of the software up-to-date is just "apt-get update; apt-get dist-upgrade". Microsoft has Debian packages for teams, skype, powershell-core, .net (core), azure-cli. Google has Debian packages for chrome. I use a lot of JetBrains' tools and keep those up-to-date using the JetBrains ToolBox. Where I work, we use Google workspace and Slack and I use those through chrome.

Just to be clear, most of my development is currently done on Linux using Rider, but I do have a Windows VM (on KVM) for older projects that run on .NET full.

The issues I come across, are related to our customers. For example when I am on location and need to connect to external hardware. One example is to connect wirelessly to a WiFi Direct display: this does not work for me and I did not investigate if there are drivers available or not. Another example is DisplayLink to use an external display through a dock: this I checked and there are drivers available and I did have it working at some point, but it broke after a kernel upgrade and it's too much bother to fix it again. Also for some customers we can connect remotely to their systems over VPN, but not all VPN solutions are available (or work out of the box) on Linux.

In any case, for my day-to-day work, I don't have any issues at all on Linux and I believe it's very very capable for coding, tooling and other work stuff. I definitely prefer it above Windows and Mac.

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

#183
post #125

Earlier quoted context omitted.

In the languages I work with (primarily JavaScript and Rust), cross-platform compatibility tends to be pretty much a non-issue. I develop on macOS, deploy on Linux, and it Just Works. No extra work required.

You forget to mention all backend services (db, redis etc are managed and you need internet connection and cloud credentials for even a development workflow.

I certainly do not use backend services that need to be hosted (if I can at all help it, which I usually can). Open source databases like Postgres and Redis are easy to install on macOS with homebrew. You can even have multiple versions install simultaneously, although I've found that Postgres tends to be backwards compatible enough that I just run everything on the latest version.

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

#184
post #179

Earlier quoted context omitted.

The same way you develop iOS applications on your Windows laptop.

Completely unrelated to how wonderful Linux tooling above anything else. By the way, for iOS I single step shaders using Metal tooling on XCode and Instruments, no need for Windows.

Nice! Now run any 32-bit program.

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

#185
post #77

Earlier quoted context omitted.

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

Easy. Just do whatever you're doing in docker natively in macos. Python, Nodejs, Ruby, Rust, Postgres, etc can all run as native macos processes. The big advantage (aside from performance) is that you gain access to all the OS-native debugging capacities. You can just look at files, open multiple terminal sessions in the same folder, use Profiler, click the debug button without special configuration in your IDE, and…

So because the macOS stack is janky, a solution is to ditch the standardization layer and run things directly in the janky stack?

That seems like a road to bringing in an entire new set of environment-specific bugs and hacks.

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

#186
post #159

Earlier quoted context omitted.

This is just really false. As someone that used Windows as my daily driver & migrated to Linux many years ago, the tooling on Linux is vastly superior. Most codebases and extensions also work trivially easy in shell, and command line operations in general are much less a pain point. I’ve since migrated to Mac because I was spending too much time making linux work properly, but I do miss the control I had. I have Wind…

So how you do you single step GPU shaders on your superior tooling?

Here is an extension for you to debug GLSL/HLSL shaders in VSCode on every platform: https://marketplace.visualstudio.com/items?itemName=dfranx.s...

NVIDIA also has a multiplatform GPU debugging sdk. I’m sure if you look at extensions for whatever IDE you’re using, you’d find what you are looking for in under 5 minutes.

You’d be surprised how good all the tooling is now days. It also isn’t my tooling, it’s everyones. That is the key difference. With Linux, you aren’t the product. People work and maintain it for the betterment of mankind and for personal satisfaction / freedom. So people care, and they are passionate, and there is a very involved worldwide community. It is more than a paycheck to them.

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

#187
post #173

Earlier quoted context omitted.

Podman has been a massive disappointment for me. I stupidly gave up my docker desktop because the company was trying to make cost savings and it was supposedly a drop-in replacement. Some short-lived containers like our repo’s linter takes easily 4x as long to run in podman as it did with Docker. Immediately I have lost productivity. It’s incredibly unreliable, every time I start my computer I have to podman machine…

When did you last use it? It _does_ support docker compose. Has for a while now actually. I love it on Linux. The Mac version is not as smooth yet, but, for my use case, still works a hell of a lot better than docker desktop. There is something deeply wrong with docker desktop's networking, and I literally have to restart it almost every time I make a change to one of our services. Not an issue with podman.

Huh this was literally 2 weeks ago I looked into this and ended up using a third-party community podman docker compose substitute. I will have another look.

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

#188
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.

I have a nearly maxed out Mac Studio and my experience was the same, until I got my work to fork out a license for parallels and I just installed docker in an ubuntu VM and configured my DOCKER_HOST on the host to talk to the vm. Now it's crazy fast.

You are maintaining all your files in the VM though, right? I'm playing with setting up a sync from vm to host so I can do that but still use my local tools.

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

#189
post #110
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.

Might be worth digging into why your rspec startup times are so slow. I recently dockerized our dev setup with separate containers for our rails backend, mysql, localstack, and rabbitmq. With Docker Desktop configured to use VirtioFS and the native virtualization framework (which is now I think the default), speeds are great. I've left my non-M1 coworkers in the dust.

It's not just rspec, any rails boot is slow. We have a pretty large project with a significant number of files and a significant number of gems, so the initial boot that loads all the constants etc is what does it.

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

#190
post #173

Earlier quoted context omitted.

When did you last use it? It _does_ support docker compose. Has for a while now actually. I love it on Linux. The Mac version is not as smooth yet, but, for my use case, still works a hell of a lot better than docker desktop. There is something deeply wrong with docker desktop's networking, and I literally have to restart it almost every time I make a change to one of our services. Not an issue with podman.

Huh this was literally 2 weeks ago I looked into this and ended up using a third-party community podman docker compose substitute. I will have another look.

https://www.redhat.com/sysadmin/podman-docker-compose

Podman listens on the docker socket, and the official docker-compose just works

Post reply on HN