lima, colima, M1
For one reason or another, you’ve switched from Docker Desktop to lima or colima and you’re on an M1 MacBook.
By default, lima and colima use qemu under the hood. To get a 1.5–2× speedup 1, you need to launch the VM with virtualization options that swap qemu for Virtualization.Framework2.
For lima:
limactl create \
--vm-type=vz \
--rosetta \
... # cpu, ram, and anything else you need to override
For colima:
colima start \
--arch aarch64 \
--vm-type=vz \
--vz-rosetta
... # cpu, ram, and anything else you need to override
Even though this is documented in the README3, many, if not all, miss this detail.
Launching this way avoids the nasty exec format error messages and the flaky segfaults when building certain Go
dependencies.
To speed up the filesystem you can also explicitly set --mount-type=virtiofs4.
Here are the arguments I typically use, for example:
colima start \
--cpu 4 \
--memory 8 \
--disk 100 \
--mount="$HOME:w" \
--mount="/Volumes/Workspace:w" \
--arch=aarch64 \
--vm-type=vz \
--vz-rosetta