This post was inspired by this Medium post. It’s a couple years old and doesn’t cover Compose.
Docker Desktop is a bit of a bloated mess and I’ve had more than my fair share of issues with it — on both Windows and macOS. When I sat down to setup my new work Macbook, I decided I wanted to rid myself of Desktop.
If you’re wanting to go Desktop-free with an existing install, check out this section.
Prerequisites
- macOS
- Homebrew
Docker Installation
The installation is fairly easy and straight forward. Start by installing Docker and its credential helper to use macOS’s Keychain to store remote registry credentials:
brew install docker docker-credential-helper
Colima Installation
Now, install Colima for the container runtime:
brew install colima
Once that installation completes, start Colima:
colima start
By default, Colima doesn’t start at login so you’d need to use the above command each time you wanted to run Docker containers. You can start it automatically with Homebrew Services:
brew services start colima
And that’s it! You’re all done setting up Docker without Desktop.
You can set Colima’s resource limits or install Docker Compose.
Setting Colima’s Resource Limits
By default, Colima’s VM has 2 CPU cores, 2GB of RAM, and 60GB of space.
You can customize it with colima start --edit
. This will open the startup configuration in vi
. You can edit the file and then save it with :qw
. Colima will prompt you to restart the VM once you save.
Some startup settings (like architecture, runtime, and VM type) cannot be changed once the VM is created. You’ll need to start a fresh VM:
colima delete
colima start
Docker Compose
If you use Docker Compose, there’s some additional setup that needs to happen.
Install the Docker Compose plugin:
brew install docker-compose
For docker
to recognize the plugin, you’ll need to update ~/.docker/config.json
to look in the Homebrew directory. It should look something like this:
{
"auths": {},
"credsStore": "osxkeychain",
"currentContext": "colima",
"cliPluginsExtraDirs": [
"/opt/homebrew/lib/docker/cli-plugins"
]
}
From Desktop to No Desktop
This section includes a mixture of commands from the official Docker uninstall page and a Stackoverflow question. Thanks to my coworker Jeff for helping me source and test a lot of this. 🙂
If you’re moving from an existing installation of Docker Desktop, you’ll need to first remove Docker Desktop, its components, related files, and packages. This will delete all volumes, images, and containers!
The uninstaller should remove most of the Docker data, but stop all containers and clean up to be on the safe side:
docker stop $(docker ps -a -q)
docker system prune --volumes --force
Run the uninstaller for the Docker app:
/Applications/Docker.app/Contents/MacOS/uninstall
Remove any dangling data (some of this may be unnecessary or throw an error if it doesn’t exist, it’s safe to ignore):
rm -rf ~/Library/Group\ Containers/group.com.docker
rm -rf ~/Library/Containers/com.docker.docker
rm -rf ~/.docker
rm -f /usr/local/bin/docker*
rm -rf /usr/local/share/boot2docker
rm -rf /usr/local/bin/hub-tool
rm -rf /usr/local/bin/kubectl.docker
rm -rf /usr/local/bin/com.docker.cli
Forget Docker-related packages:
pkgutil --forget io.docker.pkg.docker
pkgutil --forget io.docker.pkg.dockercompose
pkgutil --forget io.docker.pkg.dockermachine
pkgutil --forget io.boot2dockeriso.pkg.boot2dockeriso