Docker on macOS without Docker Desktop

After the recent announcement from Docker that Docker Desktop for Mac won't be free anymore, I tried to find an alternative to run my Docker containers.

These are the raw instructions to get it running with Multipass:

# Install multipass
brew install multipass
multipass launch -v --cpus 8 --mem 8G --disk 80G --name docker
multipass exec docker -- bash

# Update system
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install build-essential -y

# Fix DNS
Edit /etc/systemd/resolved.conf
systemctl restart systemd-resolved

# Install docker
sudo systemctl edit docker.service
curl -sSL | sh
sudo usermod -aG docker $USER

# Configure Docker
sudo systemctl edit docker.service
	ExecStart=/usr/bin/dockerd -H fd:// -H tcp://
sudo systemctl daemon-reload
sudo systemctl restart docker.service

# Install client on OSX
# (Outside multipass)

# Configure it to always use -H
Get the ip from `multipass info docker`
Add export DOCKER_HOST= to your ~.bashrc or equivalent

# Test it
docker run hello-world