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

ChaosAngel

macrumors member
Original poster
Sep 29, 2005
91
15
UK
Anyone been testing the Docker Public Preview for Apple M1?

In my initial testing, everything appears to be working. However, Docker is VERY slow.

Example use case... I have a simple Jekyll build using the official image.

On my 16-inch MBP it completes in 299 seconds.
On my old 12-inch MB it completes in 630 seconds.

The MacBook Air running the M1 SoC completes in 615 seconds (only just beating the old Intel i7-7Y75).

By comparison, the same workload on my Razer Blade 15 Advanced running WSL 2 on Windows 10 completes in 84 seconds.

I'm assuming the following limitations:

1. Docker on M1 is pre-release (public preview), therefore likely not optimised for the new architecture.

2. The Apple Virtualisation Framework is very immature.

3. Although Docker supports multi-platform images, I suspect the majority are still built using the x86 architecture, therefore not native to the Apple M1.

Do others have the same experience?
 

jdb8167

macrumors 601
Nov 17, 2008
4,859
4,599
Is it running in amd64 emulation? I wouldn’t expect too much overhead from the virtualization. The hypervisor framework has been around since before Catalina though Apple has added features but it is not new.
 

bill-p

macrumors 68030
Jul 23, 2011
2,929
1,589
In my initial testing, everything appears to be working. However, Docker is VERY slow.

I suspect it's because of this:

Docker Desktop ships with hypervisors for the host OS. The hypervisor is responsible for running a lightweight Linux kernel (LinuxKit), which is included as part of Docker Desktop. This fast and lightweight container OS comes packaged with the QEMU emulator, and comes pre-configured with binfmt_misc to run binaries of any supported architecture.

...that was from the link that you provided.

So perhaps x86/x86-64 images are being ran through QEMU's emulation code, which would explain the slow performance.

P.S.: I found this:

Not sure if it's usable, but may be worth a try?
 

Gnattu

macrumors 65816
Sep 18, 2020
1,107
1,671
So perhaps x86/x86-64 images are being ran through QEMU's emulation code, which would explain the slow performance.
If they just blindly calling qemu-system-x86_64 on an Apple Silicon Mac, then it will use emulation mode to fake an x86 CPU using a software because hvf is not available for x86_64 on Apple Silicon Macs, and this will be very slow. If this i the case I hope this mode should be disabled as default because this will cause so much confusion in the first places as we are transparently using a very slow compatibility mode.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.