-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Describe the bug
On macOS with Docker Desktop running, Strix reports "DOCKER NOT AVAILABLE" and fails to start, even though docker ps works and containers are running.
This happens because check_docker_connection() relies on docker.from_env(), which on this machine defaults to the Linux-style socket unix:///var/run/docker.sock. On this macOS setup, that socket does not exist; Docker Desktop exposes its socket at ~/.docker/run/docker.sock (and/or ~/Library/Containers/com.docker.docker/Data/docker.raw.sock), so the Python Docker client cannot connect.
Why this only affects some macOS users
- On some systems,
DOCKER_HOSTis set (by Docker Desktop, shell config, or alternative runtimes like colima), sodocker.from_env()connects successfully via that endpoint. - On others,
/var/run/docker.sockis present or symlinked to the real Docker Desktop socket, so the Linux-style default still works. - On this machine,
DOCKER_HOSTis empty and/var/run/docker.sockdoes not exist, while~/.docker/run/docker.sockdoes. That combination exposes the bug.
To Reproduce
Steps to reproduce the behavior:
- On macOS, install and start Docker Desktop.
- Confirm Docker CLI works:
docker psreturns running containers. - Ensure
DOCKER_HOSTis not set in the shell environment. - Confirm
/var/run/docker.sockdoes not exist, but~/.docker/run/docker.sockdoes. - Run:
poetry run strix --target https://settle-cardhouse-prod.appspot.com - Observe the "DOCKER NOT AVAILABLE" startup error.
Expected behavior
- Strix should detect and connect to Docker Desktop’s socket on macOS (e.g.
~/.docker/run/docker.sockor~/Library/Containers/com.docker.docker/Data/docker.raw.sock) whenDOCKER_HOSTis unset and/var/run/docker.sockis missing. - Error messages should provide OS-appropriate guidance:
- On macOS: suggest ensuring Docker Desktop is running (e.g.
open -a Docker). - On Linux: suggest relevant service commands (e.g.
sudo systemctl start docker).
- On macOS: suggest ensuring Docker Desktop is running (e.g.
Environment
- OS: macOS (Darwin)
- Docker: Docker Desktop
dockerCLI: works (docker pssucceeds)DOCKER_HOST: unset/var/run/docker.sock: missing~/.docker/run/docker.sock: present
Screenshots
System Information:
- OS: macOS 26.1
- Strix Version or Commit: 0.4.0
- Python Version: 3.13.17
- LLM Used: N/A
- Docker: Docker Desktop
dockerCLI: works (docker pssucceeds)DOCKER_HOST: unset/var/run/docker.sock: missing~/.docker/run/docker.sock: present
Additional context
The docker CLI works correctly because it uses Docker contexts, but the Python docker library's from_env() method doesn't automatically detect Docker Desktop's socket location on macOS. The fix should detect the platform and try macOS-specific socket paths before falling back to the default behavior.