Skip to content

Instantly share code, notes, and snippets.

@making
Last active May 29, 2024 16:53
Show Gist options
  • Save making/347fd983c486fa26210a7f7e070874a9 to your computer and use it in GitHub Desktop.
Save making/347fd983c486fa26210a7f7e070874a9 to your computer and use it in GitHub Desktop.
Use lima instead of Docker Desktop on Mac

Install

brew install lima docker
limactl start default
lima sudo apt -y install docker.io
lima sudo usermod -aG docker $USER
limactl stop default

Start Docker

limactl start default
sudo rm -f /var/run/docker.sock -f $HOME/.lima/default/docker.sock 
ssh -p 60022 -i $HOME/.lima/_config/user -o NoHostAuthenticationForLocalhost=yes -L $HOME/.lima/default/docker.sock:/var/run/docker.sock -N -f 127.0.0.1
sudo ln -s $HOME/.lima/default/docker.sock /var/run/docker.sock
docker ps

Stop Docker

kill $(ps aux | grep 'docker.soc[k]' | awk '{print $2}')
limactl stop default
@ahmetuludag
Copy link

I recommend colima (https://github.com/abiosoft/colima). When you start it, automatically brings up lima services directly to be used by docker client. You can also make it auto-start at boot.

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