Goodbye Docker Desktop
Docker in macOS has always been a second-class experience due to the operating system's lack of the required Linux kernel features for native containerization. Because of this, Docker Desktop is the industry-standard way of getting Docker containers running in macOS.
In short, Docker Desktop is an Electron-based GUI application that runs and manages a Linux virtual machine in which containers are actually run.
The application handles:
- The allocation of hardware resources to the VM
- The exposure of a Unix socket for the macOS-native Docker CLI
- The management of volume mappings and networking between macOS and the VM
Despite working well enough for many years the application has continued to bloat, and the Docker organization has begun heavily pushing a subscription model for anything beyond personal use. Maybe it's just me, but I don't want open-source software I rely on to be wrapped in an increasingly blatant monetization layer.
Colima
In the search for alternatives to Docker Desktop (as virtualization is still a requirement) I came across Colima.
Colima's high-level features:
- Intel and M1 Mac support
- Simple CLI interface
- Docker and Containerd support
- Port forwarding
- Volume mounts
- Kubernetes
Colima has done away with the GUI requirement!
Setup
First, uninstall Docker Desktop completely.
I also chose to purge the ~/.docker directory in service of freshness.
Then install Colima and Docker via Homebrew:
If needed, install the Docker Buildx plugin:
ARCH=amd64 # change to 'arm64' for m1
VERSION=v0.9.1
Start Colima:
Check Colima status:
Lastly, set DOCKER_HOST to this new Unix socket in ~/.bashrc or ~/.zshrc (or other shell profile):
Usage
Just like Docker Desktop, without Docker Desktop.
Pull an image:
Run an image:
Port forwarding!
<!DOCTYPE <html>
<head>
<title>Caddy <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="data:,">
<style>
It feels good to no longer have Docker Desktop in my menu bar.