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
	[Resolve]
	DNS=8.8.8.8
	FallbackDNS=1.1.1.1
systemctl restart systemd-resolved

# Install docker
sudo systemctl edit docker.service
curl -sSL https://get.docker.com/ | sh
sudo usermod -aG docker $USER

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

# Install client on OSX
# (Outside multipass)
Do https://docs.docker.com/engine/install/binaries/#install-client-binaries-on-macos

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

# Test it
docker run hello-world

In the next few days I’ll update this post with a better guide, including screenshots and troubleshooting options.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s