Skip to content

Instantly share code, notes, and snippets.

@juliangroen
Last active March 26, 2024 09:29
Show Gist options
  • Save juliangroen/907edcc8fc45441f1ab2405afe6eaff6 to your computer and use it in GitHub Desktop.
Save juliangroen/907edcc8fc45441f1ab2405afe6eaff6 to your computer and use it in GitHub Desktop.
Using Lima-vm to replace Docker Desktop on macOS

Replacing Docker Desktop with Lima-vm on macOS

Uninstall Docker Desktop

Navigate to Applications in Finder and drag "Docker" to the trash can

Remove Docker config file

mv ~/.docker/config.json ~/.docker/old-config.json

Install Lima

brew install lima

Install docker packages via homebrew

brew install docker docker-compose docker-credential-helper

Start up a lima VM using the docker template

limactl start --name=docker template://docker

The output from the previous command will provide instructions to add lima as the docker context (may be different than what is below)

Replace {YOURUSERNAME} with your macOS username

docker context create lima --docker "host=unix:///Users/{YOURUSERNAME}/.lima/docker/sock/docker.sock"

docker context use lima

docker run hello-world

In the future you start the VM with

limactl start docker

Optional: Increase Resources for the lima VM

Stop the VM if it is currently running

limctl stop docker

Open the VM config in your default text editor

limactl edit docker

Add the following as root level items in the config (customize to your use case)

cpus: 8 memory: 8GiB

Restart your VM

limactl start docker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment