strix icon indicating copy to clipboard operation
strix copied to clipboard

Fix: Add macOS Docker socket detection fallback (Fixes #164)

Open Armankb2 opened this issue 2 weeks ago • 0 comments

Summary

This PR fixes Issue #164 where Strix fails to detect Docker on macOS even when Docker Desktop is running.

docker.from_env() only checks Linux-style sockets and does not detect Docker Desktop’s macOS socket locations such as:

  • ~/Library/Containers/com.docker.docker/Data/docker.raw.sock
  • ~/.docker/run/docker.sock

As a result, Strix incorrectly reports "DOCKER NOT AVAILABLE" on macOS systems.


What this PR changes

✔ Tries docker.from_env() first (respecting DOCKER_HOST).
✔ If that fails, tries macOS-specific Docker Desktop socket paths.
✔ Falls back to Linux sockets on non-macOS platforms.
✔ Improves error messaging showing exactly which sockets were checked.
✔ Preserves existing Linux behavior — zero regressions.


Why this is needed

Many macOS users run Docker Desktop, which exposes a different socket path than Linux.
The Python docker SDK does not automatically detect these locations, causing Strix startup failure.

This PR makes Strix behave correctly on:

  • macOS Docker Desktop
  • Linux Docker Engine
  • Systems with DOCKER_HOST set
  • Systems without Docker at all (clearer errors)

How to test

On macOS (Docker Desktop running): python3 - << 'EOF' from strix.interface.utils import check_docker_connection client = check_docker_connection() print(client.ping()) EOF

Expected: No error, prints None.

On Linux:

Existing behavior should remain identical.


Related Issue

Fixes #164


Additional Notes

This change is minimal, contained, safe for cross-platform usage, and aligns with behavior maintainers requested in the issue discussion.

Armankb2 avatar Dec 12 '25 13:12 Armankb2