TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Docker on MacOS is slow and how to fix it

193 pointsby riccardomcover 2 years ago

26 comments

kdrag0nover 2 years ago
Funny that this came up — shameless plug: I&#x27;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:<p>- Fast networking: 30 Gbps! vs. 150 Mbps with Docker VPNKit. Full VPN compatibility, IPv6, ping, ICMP and UDP traceroute, and half-open TCP connections.<p>- 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.<p>- Not limited to Docker or Kubernetes. You can run multiple full Linux distros as system containers (like WSL) so they share resources.<p>- Fast x86 emulation with Rosetta<p>- 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!<p>- Better solutions to other problems that can occur on macOS: clock drift is corrected monotonically, dynamic disk size, and more I&#x27;m working on now. Will look into memory usage too, although I can&#x27;t guarantee a good fix for that.<p>- No root needed.<p>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.<p>If anyone is interested, drop me an email (see bio) and I&#x27;ll let you know when this is ready for testing :)<p>Also, feel free to ask questions here or let me know if there are other warts you&#x27;d like to see fixed.
评论 #34102313 未加载
评论 #34101283 未加载
评论 #34105108 未加载
评论 #34104687 未加载
评论 #34103048 未加载
andixover 2 years ago
Often overlooked: there is also podman machine and podman desktop (for windows and macOS). It is not as fancy as docker, but fully free and open source.<p>It provides docker compatibility to some extent, you don’t need a license and it’s much less heavy than docker desktop. If you need kubernetes, there is also minikube, which provides a lot of options.<p>Most of the things discussed in this article still apply for podman machine and minikube.
评论 #34100464 未加载
评论 #34104361 未加载
评论 #34101565 未加载
评论 #34100801 未加载
jscheelover 2 years ago
Docker is cripplingly slow on MacOS. I have a maxed out 16&quot; 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&#x27;s absolutely impossible to be ok with those numbers.
评论 #34101827 未加载
评论 #34102204 未加载
评论 #34100637 未加载
评论 #34122832 未加载
EdwardDiegoover 2 years ago
My preferred fix: don&#x27;t develop in Docker.
评论 #34099949 未加载
评论 #34099370 未加载
评论 #34101796 未加载
TimTheTinkerover 2 years ago
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.<p>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&#x27;s config.
评论 #34101850 未加载
mccolinover 2 years ago
With VirtioFS on the scene I just don’t have this experience anymore. Docker for Mac is significantly faster than it used to be, particularly when using named volumes.<p>Mutagen also improved the experience but I prefer VirtioFS as it’s “built-in”
doctobogganover 2 years ago
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&#x27;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.<p>I also develop frontends using vue, managed by npm. In my experience this doesnt need to be dockerized since npm installs everything in a subdirectory per project. Is there a benefit to running this as a dockerized app?
评论 #34100074 未加载
评论 #34099816 未加载
评论 #34100035 未加载
评论 #34100282 未加载
评论 #34099791 未加载
评论 #34100712 未加载
评论 #34104383 未加载
评论 #34099756 未加载
评论 #34099664 未加载
评论 #34099738 未加载
评论 #34099833 未加载
tropshopover 2 years ago
I have Apple Silicon but develop on docker x86. The game changer for me was macOS Ventura with rosetta support for linux vms.<p>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.<p>Battery lasts all day and the machine stays ice-cold.<p><a href="https:&#x2F;&#x2F;docs.getutm.app&#x2F;advanced&#x2F;rosetta&#x2F;" rel="nofollow">https:&#x2F;&#x2F;docs.getutm.app&#x2F;advanced&#x2F;rosetta&#x2F;</a>
SirensOfTitanover 2 years ago
The most recent version of Colima supports both virtiofs and mac&#x27;s native virtualization framework (macOS 12.5+). I get totally acceptable performance using it.
therealmarvover 2 years ago
Is not this the main way to speed up Docker on Mac: use a beefed up Linux Virtual Machine (VirtualBox, UTM, tart) and run Docker inside this Virtual Machine?
评论 #34099731 未加载
评论 #34099958 未加载
评论 #34100664 未加载
rcarmoover 2 years ago
I stopped using Docker desktop and just forwarded my Docker CLI to a VM’s TCP port the instant I found how it exported my Mac file system wholesale to the Docker VM. Never looked back, and these days I just use sshfs or VSCode to develop remotely (which works everywhere).
wood-porchover 2 years ago
A project I made solved this by running docker on AWS and doing two-way file sync on changes. Runs quite nicely and transparently.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;lime-green&#x2F;remote-docker-aws">https:&#x2F;&#x2F;github.com&#x2F;lime-green&#x2F;remote-docker-aws</a><p>Lots of benefits: speed, battery, fan noise
评论 #34101094 未加载
hakanderyalover 2 years ago
I finally gave up the effects of Docker on performance and battery life and switched to Windows. I still don&#x27;t have a long lasting battery, but at least performance is better.
评论 #34099659 未加载
SanjayMehtaover 2 years ago
We gave up on Docker on macOS long ago. Wherever we absolutely need Docker, we just throw a Linux machine at it. Developer time is costlier than hardware.
xenoscopicover 2 years ago
If anyone has any questions about Mutagen (or integrating it into their Docker-based workflows), I&#x27;m happy to help.<p>Just one clarification on the article: Mutagen offers Docker Compose integration, not Compose<i>r</i> integration (Composer is a PHP package manager). However, as mentioned, DDEV is a great option if you&#x27;re looking to do containerized PHP development while using Mutagen for performance improvements.
aliljetover 2 years ago
Have any of you tried to chase the microvm train instead of docker on MacOS? Thus far, it feels like this is a deeply lost cause with a passing hope that somehow you can hack a solution to nested virtualization and drop into a KVM-style experience on a guest vm and then go a layer deeper with microvms on top of that guest. Oofff. What an absolute horror show.
kevinhqover 2 years ago
&gt; 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.<p>source: <a href="https:&#x2F;&#x2F;kvz.io&#x2F;macos-install.html" rel="nofollow">https:&#x2F;&#x2F;kvz.io&#x2F;macos-install.html</a>
drcongoover 2 years ago
I have a large, fairly complex Django application that I run in containers on a MBP with an M1 Pro, and it runs twice as fast as the AMD 16 core production server. It was a bit of a dog on an Intel Mac, but everything I use Docker for is blazing fast on Apple Silicon. Is there something about Python apps that makes this different?
xwowsersxover 2 years ago
I have &quot;use virtualization&quot; turned on in Docker Desktop for Mac, but I don&#x27;t see different options for the file sharing implementation. I&#x27;m currently on version 4.14.1 (91661).<p>Separately, with &quot;use virtualization&quot; turned on, should I also enable &quot;VirtioFS accelerated directory sharing&quot;?
评论 #34103478 未加载
benfrancomover 2 years ago
I’m interested to see how project finch works out compared to Docker on a Mac. It’s an open source client for container development.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;runfinch">https:&#x2F;&#x2F;github.com&#x2F;runfinch</a><p>When I tried Rancher Desktop it didn’t work so well.
totalhackover 2 years ago
I fixed this problem by not getting a MacBook Pro this year when my last one from 2018 had no battery and two letters falling off the keyboard.<p>Bonus: paid half what a similarly spec&#x27;d M2 Air would cost.
ffactoryover 2 years ago
Cool blog theme, feel like I&#x27;ve seen it before ;) <a href="https:&#x2F;&#x2F;filippo-orru.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;filippo-orru.com&#x2F;</a>
rootusrootusover 2 years ago
Funny thing is that I switched from virtualbox for Vagrant on OSX over to Docker because vbox file operations were so incredibly slow.
nsonhaover 2 years ago
Why would you want to mount node_modules? it&#x27;s useless on the host because the binaries are for a different arch
westoqueover 2 years ago
this is one of the reasons i changed my OS to linux since docker there works natively. i believe there will always be a bottleneck for peak performance on macOS until we are able to run natively, not virtualized.
KyeRussellover 2 years ago
It’s no surprise that these replies have seen the usual jarring unfriendly personalities come out of the woodwork to advocate for the absolute use of desktop Linux.