Skip to content

Conversation

@Armankb2
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Strix fails to connect to Docker on macOS

1 participant