Skip to content

Instantly share code, notes, and snippets.

@kojilin
Forked from trustin/setup-docker.sh
Created February 8, 2024 06:11
Show Gist options
  • Select an option

  • Save kojilin/f6fa46e0519066a94c6cbf3925350f17 to your computer and use it in GitHub Desktop.

Select an option

Save kojilin/f6fa46e0519066a94c6cbf3925350f17 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