Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
Not dropping support.

 
  • Like
Reactions: Xiao_Xi
Docker performance on a mac has always had terrible file system performance, just try adding a watcher task in any project. Docker on Apple Silicon (ARM) is tenfolds worse, like described in the first posts here, but the worst place to be is where I am: having to use a specific old Ubuntu Docker image that only exists for x86 and then having to run it on an ARM Mac ?

The by far best option I have tried so far is simply not running Docker on the mac: instead delegating it to a dedicated x86 Linux host. This great article compares several approaches for speeding up Docker on Mac, and all the best performing ones use `Mutagen` to sync your working dir to the Linux host. There is no mention of ARM vs x86 in his article, but since running an x86 VM is only possible using Parallels (AFAIK, VMWare and VirtualBox is a no go) that might not be an option.

The best performing one, which is what I am using, is having a dedicated VPS. Actually, I set up a reverse SSH tunnel to my beefy work computer, which is the thing doing the actual work. This has made doing Docker related stuff go from impossible (due to the poor performance) to joyful.
 
No, because it does not do magic ;)
For example, in the case of a simple Dockerfile like this that is built for two architectures, BuildKit will pull two different versions of the Alpine image, one containing x86 binaries and another containing arm64 binaries, and then run their respective shell binary on each of them.
As I mentioned, my source image is Ubuntu 18.04. The ARM version of Ubuntu Server is a relatively recent addition (20.04), so there is no alternate version of the `ubuntu` Docker image for 18.04 using arm64.

There does exist arm64 versions of older Ubuntu's, though, like the ones built for Raspberry PI, but these are not available as official dual platform docker images, so it would take some work to create that.
 
Docker for Mac performance continues to be horrible on the M1. Does anyone know if Docker plan to improve this situation? Are they already using the Apple Hypervisor framework (I'm guessing not).

As an example, I have a simple JAMstack (Jekyll) build, which takes approximately 70 seconds to complete on my My Dell XPS 17 (Intel Core i9-11900H) using an x86 image. This is the case running Windows 11 (WSL2) or Linux (Pop!_OS).

The same build (with an ARM64 image) takes 460 seconds on the M1 Max, with Docker assigned 8 Cores and 8GB.

However, if I launch Linux (Ubuntu Server ARM64) via UTM, I can execute the exact same build in just 9 seconds!!!

9 seconds is an incredible result, but it is painful that I have to run a local Ubuntu image to achieve that performance.

Any thoughts? Any way to optimise the performance of Docker on macOS?

Docker for Mac has very slow Disk I/O access, it is being worked on actively - https://github.com/docker/roadmap/issues/7
 
  • Like
Reactions: fatso83
They have released a new version with no Rosetta dependencies. If you run native Arm64 images you will get great performance. x86 will be under QEMU and will perform less so.

It's not just the performance that is poor under QEMU emulation. I often need to build x86/amd64 images and often get segfaults. For this reason I'm using a VPS as a remote Docker host. But it sucks. I wish the emulation worked better.
 
It's not just the performance that is poor under QEMU emulation. I often need to build x86/amd64 images and often get segfaults. For this reason I'm using a VPS as a remote Docker host. But it sucks. I wish the emulation worked better.
Well you are out on the bleeding edge trying to build amd64 Docker images on an M1 Mac. One reason I opted to buy a 2020 27" i9 iMac just after the Apple Silicon announcement was announced is so I could continue to build am64 Docker images without having to provision a remote Docker host.

It generally works well (though building the AWS C++ SDK in a Docker Container does take a very long time). OTOH It makes debugging code running in a container easier, particularly now CLion has added a Docker toolchain with its latest release (the first to natively support Silicon). It's also nice to be able to quickly spin up an amd64 Ubuntu VM locally.

I also do some .NET Core development on my Mac (deploying as a Docker Image) and ARM support isn't quite there yet for that either (Only .NET 6 is supported).
 
Last edited:
It's not just the performance that is poor under QEMU emulation. I often need to build x86/amd64 images and often get segfaults. For this reason I'm using a VPS as a remote Docker host. But it sucks. I wish the emulation worked better.
You could just deploy to Arm64. They're out there.
 
Has anyone tried to run Docker with Multipass on one of the new Macs?

and Minikube?

How is the experience?
 
Last edited:
I did a short writeup on how to run minikube with multipass.
It's brilliant! How is the performance and user experience?

Docker has never been a great experience on the Mac, but with the arm64 architecture it appears to have become even worse.
Can you explain it a little more?

minikube as the docker driver is currently the only driver that’s supported on M1 macs.
- Which is the best driver for Intel Macs?
- Will minikube on Silicon Mac be affected by Kubernetes dropping support for Dockershim?

Is kind better/worse than minikube?
 
Last edited:
It's brilliant! How is the performance and user experience?


Can you explain it a little more?


- Which is the best driver for Intel Macs?
- Will minikube on Silicon Mac be affected by Kubernetes dropping support for Dockershim?

Is kind better/worse than minikube?
The performance is excellent. First I did give minikube on the mac a try. Unfortunately that currently only supports the docker driver. Although I restricted docker's resources to 3GB I eventually noticed the docker process eating 18GB!
Besides that the file I/O performance on docker on osx is terrible.

Before when I used an intel mac for development I used the vmware driver for minikube as that performed a lot better w.r.t. file I/O.

After my minikube writeup I gave k3s in a Ubuntu VM on Parallels Desktop a try, you can read about that here. https://www.materialized.eu/kubernetes/k3s-on-ubuntu-in-parallels-desktop-on-m1-mac. I think that will be my main local k8s solution for now, until something more useful comes along. I assigned 2 CPUs and 6GB of RAM to the VM and am running MongoDB, Kafka/Zookeeper, ElasticSearch and our application and it works like a charm.
 
Although I restricted docker's resources to 3GB I eventually noticed the docker process eating 18GB!
You've confirmed what I had read: Docker doesn't respect allocated resources.

file I/O performance on docker on osx is terrible
It seems the problem is related to:

And Docker could have a solution soon.

Kafka/Zookeeper
Does Kafka still need Zookeeper?
 
  • Like
Reactions: uiterlix
And Docker could have a solution soon.

Docker seems to run better on ARM Macs because it uses the virtualization framework instead of the hypervisor framework. Can someone confirm it?
docker-exp.png
 
Is anyone building x86 images these days? I wonder if the QEMU support has improved. I was having problems with sigfaults and extremely slow builds so I've been using my Intel MBP 16" as remote Docker engine from my M1 mini, which works great for just building. Port forwarding and volume binds are another story.... Has QEMU stuff improved?
 
Docker seems to run better on ARM Macs because it uses the virtualization framework instead of the hypervisor framework. Can someone confirm it?
View attachment 1965218
This, mine was slow until I did this... Never used a used Docker with Windows machine to compare, so I am not sure what the performance is like, but I definitely don't want to having to deal with C drives and \ (forward slashes) haha.
 
  • Like
Reactions: Xiao_Xi
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.