To fix the "cannot connect to the Docker daemon at unix:///var/run/docker.sock" error on macOS, try exporting the following:
export DOCKER_HOST=unix://$HOME/.docker/run/docker.sock
Alternatively, you can use Docker over TCP. Here's how to configure Docker Desktop to expose the Docker daemon via TCP instead of a Unix socket:
- Open Docker Desktop.
- Navigate to Settings > General.