Newer MacOS laptops have M-series processors which are arm64, not x86/64 like their Intel predecessors. Some docker images do not have an arm64 image yet released to public registries (I’m looking at you mcr.microsoft.com/mssql/server:2019-latest) and other tooling might be better utilized through docker (donet prior to v7 doesn’t have a native arm64 binary).
Instructions
Run your container
docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=VeryStr0ngP@ssw0rd" -p 1433:1433 --name sql --hostname sql-server --platform linux/amd64 -d mcr.microsoft.com/mssql/server:2019-latestSet up your shell to look and feel like docker
alias docker='lima nerdctl'
alias docker-compose='lima nerdctl compose'Start the VM
limactl start defaultCreate a VM with the required parameters (use default to make things easier)
vmType: "vz"
rosetta:
# Enable Rosetta for Linux.
# Hint: try `softwareupdate --install-rosetta` if Lima gets stuck at `Installing rosetta...`
enabled: true
# Register rosetta to /proc/sys/fs/binfmt_misc
binfmt: truebrew install limaTroubleshooting
I have observed a propensity for the VM to become unresponsive, at least on Ventura. This can be checked a few ways:
- Virtual Machine Service uses > 100% cpu when you are not running anything intensive
- Using lima commands fails to connect to the VM (hangs) ex:lima nerdctl ps
This usually happens after a sleep/wake cycle. The only way I’ve found to fix it is to completely remove the vm via limactl factory-reset default and recreate the vm, which only takes limactl start default as the config still exists. Some times that can fail to create a clean VM so you may have to redo it several times.