Solve the problem that mac system cannot detect docker #7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
Currently, the Docker detection logic in run.py fails to properly detect Docker Desktop on macOS systems. While Docker Desktop is installed and running, the script reports "No container engine found" because it only checks the default Docker environment and Colima, but doesn't account for macOS-specific Docker Desktop socket paths.
This issue prevents users from running CodeAssist on macOS with Docker Desktop, even when Docker is properly installed and functioning via command line.
Summary of Change
Enhanced the detect_docker function to comprehensively detect Docker on macOS systems by:
Maintained existing logic: First attempts default Docker environment detection
Added macOS-specific path detection: When on macOS (sys.platform == "darwin"), the function now checks multiple common Docker Desktop socket paths:
Standard Docker Desktop path: unix:///var/run/docker.sock
User directory Docker socket: unix://~/.docker/run/docker.sock
Homebrew Docker path: unix:///usr/local/var/run/docker.sock
Preserved Colima support: Existing Colima detection logic remains unchanged
The function now iterates through these potential paths, attempting to establish a Docker connection with each until one succeeds or all options are exhausted.