Skip to content

Instantly share code, notes, and snippets.

@trustin
Created January 10, 2024 11:37
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save trustin/bbf10f4161ca2a5c51b0118381ee5818 to your computer and use it in GitHub Desktop.
Save trustin/bbf10f4161ca2a5c51b0118381ee5818 to your computer and use it in GitHub Desktop.
How to install Docker on macOS without using Docker Desktop
#!/usr/bin/env bash
set -Eeuo pipefail
# Install Docker CLI and Docker Compose, etc.
brew install docker docker-compose docker-credential-helper
# Configure Docker CLI.
mkdir -p "$HOME/.docker/cli-plugins"
ln -sfn '/opt/homebrew/opt/docker-compose/bin/docker-compose' "$HOME/.docker/cli-plugins/docker-compose"
echo '{
"auths": {},
"credsStore": "osxkeychain",
"currentContext": "colima"
}' > "$HOME/.docker/config.json"
# Install Colima and start the Docker engine with it when the current user logs in.
brew install colima
sudo ln -sfn "$HOME/.colima/docker.sock" /var/run/docker.sock
sudo chown -R "$(id -u):$(id -g)" "$HOME/Library/LaunchAgents"
brew services start colima
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment