Hacker News new | past | comments | ask | show | jobs | submit login

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.


IntelliJ autosyncs all my files to the VM seamlessly using rsync, yes. I've considered switching to use the remote development features in intellij and just managing everything in the VM and not having anything on the host but I haven't had any trouble with my current setup so I haven't bothered tbh.


I use k8s in Docker desktop, so I tried using ksync, but it’s just broken. Lots of reports of it not working. I’m gonna play with a rolling my own syncing solution, either host -> vm or the other way around.


How does file sharing performance compare?


I automatically sync my workspace to the VM using IntelliJ and rsync so I don't mount any host filesystems in the VM for docker. I just use linux native volumes inside the vm itself and it works fine for me so far. It takes a bit of configuration from the IDE side but it works pretty seamless once it's setup.


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.


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?


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 on. All without needing to think about VM images, docker containers, networking and all that rubbish.

The downside is you need to set up a second build environment (which might not match your deployment environment). Unless you're doing something truly special, setting up a macos-native build environment is usually pretty easy. Its normally just a few "brew install" / "npm" / "gem install" / "cargo build" etc commands away from working.


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.


yes. it's not that i like macOS, but I need its xcode.


I use Docker inside of Parallels running Linux and get far better performance than Docker Desktop.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: