Docker doesn't run natively on OSX, unlike Linux where it does. As a result, Docker Desktop for Mac spins up a linux VM, and this is where penalties begin to be payed.
I do wonder if Docker Desktop is smart enough to tailor the VM's architecture to the image's architecture? Moreover, is it smart enough to tailor both the VM's architecture and images architecture to the host's hardware architecture?
I'd be interested to see how these soft and hard architecture combinations actually change the performance characteristics:
M1/ARM -> x86-VM -> ARM-image
vs
M1/ARM -> ARM-VM -> ARM-image
I wonder how difficult it would be to support docker natively on OSX (BSD?) or if Apple has any intention on providing that support?I think it would be pretty difficult. Mac would effectively have to provide a fully compatible Linux interface in its kernel. It would probably be more likely to build a better fs-event bridge to guest systems, but considering MacOS still doesn’t have ext4 support, I’m not counting on it.
Though as you note they're completely different classes of hardware (500W vs. 26.5W), a more Apples-to-Apples (so to speak) comparison would be native Ubuntu on both systems, though as I understand it Ubuntu for M1 is not complete and may lack GPU support and other important features.