snippets > use-lima-as-docker-desktop-replacement-macos

October 03, 2022

Use Lima as a Docker Desktop replacement on MacOS

Lima (short for Linux on Mac) is a Virtual Machine management tool for running Linux boxes (think Vagrant, but for development tooling). It focuses on offering a convenient way to run and interact with containerd, but its high customizability allows for a lot more. The examples folder in its repository gives a good idea of what it’s capable.

For running Lima as a Docker Desktop replacement, the official example provided is a great starting point with a few shortcomings:

  • mounting only a temporary folder (/tmp/lima) as writable
  • using sshfs as the mount type (this can cause problems with containers that run chown on startup like Jupyter and Gogs)
  • not including support for building and running multi-arch containers

To circumvent these issues, download this YAML and run:

limactl start docker.yml

If docker login gives you trouble, make sure that ~/.docker/config.json uses osxkeychain as the credsStore. Example:

  "auths": {},
  "credsStore": "osxkeychain"

Further reading

Filesystem mounts available for Lima

VM customization options