We've all heard the jokes from practically anyone with their development environments on Docker for Mac: it makes your Mac sound like a jet plane a...
For further actions, you may consider blocking this person and/or reporting abuse
An alternative I found was to use NFS:
medium.com/@sean.handley/how-to-se...
firehydrant.io/blog/nfs-with-docke...
jeffgeerling.com/blog/2020/revisit...
I used to work with Docker for MacOS (with NFS volume) and indeed it's much faster than use the default volume map but even NFS volume is very, very slow compare to Docker on Linux, it's unbelievable.
Good links, Pedro. We'd looked into this as well, but it seemed docker-sync was a smidge faster and slightly more reliable. NFS looked solid overall though!
We use nfs to setup our devenv across all of our developers computers (linux/macos), it works fine :)
@ericnograles read this!!
docs.docker.com/docker-for-mac/osx...
Basically adding the "delegated" flag to docker volumes will help AMAZINGLY with CPU and I/O performance. Don't just trust me on it, try it!
Thanks for the link! SUPER interesting -- although if I'm reading that article above properly, it sounds like it'd be more of a
cached
(i.e. host is the authority) setup?How has your experience been day-to-day? i.e. do the container volumes ever get out of sync, and if they do, is there a quick mechanism to get them back to parity (without having to straight up
docker-compose down && docker-compose up -d
?Inspired by Windows WSL which runs a Linux VM that is integrated with Windows. I decided to setup a Linux VM on Mac and install my Docker dev environment on the Linux VM. It actually runs a lot better than my native Mac Docker environment. I'm using Parallels Desktop which is a lot more performant than Virtual Box so that could also help things as well. I haven't seen or heard of anyone else doing this but it was the only way for me to get my dev environment to run from my Mac without running out of resources.
Right there with you! I actually use a VirtualBox VM and just hook my host tooling up to it via SSH. Works so much better than Docker for Mac!
Awesome! You should write a post about :)
I used to work with Docker on MacOS for almost two years but some weeks ago I just gave up. After a comparison that I did running Docker on Linux, the MacOS version (Including the use of NFS volumes) is too slow.
If you can get rid of MacOS and use Linux, go ahead, I'm pretty sure, you won't regret.
This article is very interesting. I knew that Docker for Mac OS was different and running inside a VM, but not with such details.
However IMHO there is a little bit of exageration: it is working correctly on my machine, and the overhead in comparison with the Linux setup is not such a pain.
Thanks for sharing, Eric.
I think it's a case of YMMV here. We have a pretty I/O heavy setup with our front-end (i.e. webpack) and, without mitigation, it constantly chews through resources. Checking my Activity Monitor right now, at idle, my docker.hyperkit on my MBP sits at 40%...and that's with help from docker-sync.
Without mitigation, it's not unusual for it to sit at 90%+, especially when you're saving source code a bunch from the host.
On my work MBP with large projects it's up to about 50 times slower than on Linux running IO heavy apps, particularly those which have to monitor for changes or recursively search directories.
Great article! Built a solution to this problem that runs your local containers on remote linux machines: getporter.dev - I would love your honest thoughts on how this compares to your experience with Mutagen.
I had less issues running docker inside an Ubuntu VM than directly in Mac 😟
This makes some sense, unfortunately. If indeed the case generally, Docker devs should suggest such a solution, rather than providing a substandard VM of their own for MacOS. I'm hearing these reports after learning of "Doki malware" and I'm losing confidence in the product. Or should I say I'm losing faith in the organization behind the product.
Part of me agrees with you. However, they (Docker) are definitely in a tough spot. Whereas Microsoft was cooperative in creating a bridge to their kernel with WSL-2, Apple generally keeps macOS under lock and key. i.e. Docker for Mac will be at the mercy of the macOS Hyperkit.
The fact that the new Docker for Mac will ship with Mutagen def shows me that they hear us and are doing whatever they can to alleviate the situation.
fwiw, I've taken the Docker Edge Build with Mutagen for a spin and it's been very good! Once they work out the kinks, hopefully it consistently improves the experience for everyone.
The heating and cooling issues you're talking about will hopefully go away anyway when Macs switch to ARM
Is it not better to just install vm on your Mac, spin up a Linux OS and then install docker on that?
Better performing, definitely.
However, it does come with the additional tax of more networking overhead in the form of port forwards to/from the host/guest, or reverse proxying for more complicated setups.
I keep revisiting these posts every few months. Looks like Mutagen integration isn't happening now so I think I'll try the Linux VM as well.
Eric, thanks for the docker edge tip!.....
I had this issue for a month and at some point, I thought about taking my mac to a repair shop but this really helps me .....
Keep it up...
Idunno man, some people on my team at work just use Ubuntu, and I hear it works great for them!
Great explanation though, thanks.
Oh, you. 😆
Wouldn't the same happens when you try to run a windows based docker image on a Linux Machine?
a new Docker 3.6 had been released recently…. is Mutagen included in there ?
or maybe the Mac OS sluggishness had been treated in same other way (?!)
It's end of 2021. The docker for mac is updated at 4.2.0. Is these problems still there?
Hi!
Do you know where can I found information about Mac's performance when running a Linux Docker image vs running a Linux VM without having to run them myself? I am sure someone has measured it!