-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Problem
On macOS with Docker Desktop, with-connect fails to connect to Docker unless DOCKER_HOST is explicitly set:
docker.errors.DockerException: Error while fetching server API version:
('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
This happens because the Python Docker SDK (docker.from_env()) looks for the socket at /var/run/docker.sock, but Docker Desktop on macOS places it at ~/.docker/run/docker.sock.
Current workaround
Users must manually set:
export DOCKER_HOST=unix://$HOME/.docker/run/docker.sockSuggested fix
The docker.from_env() calls at line 134 and line 153 could be wrapped in a helper that auto-detects the macOS Docker Desktop socket:
import platform
import os
def get_docker_client():
# Auto-detect macOS Docker Desktop socket
if platform.system() == "Darwin" and not os.environ.get("DOCKER_HOST"):
mac_socket = os.path.expanduser("~/.docker/run/docker.sock")
if os.path.exists(mac_socket):
os.environ["DOCKER_HOST"] = f"unix://{mac_socket}"
return docker.from_env()This would make with-connect work out-of-the-box on macOS without requiring users to set environment variables.
Environment
- macOS (Apple Silicon and Intel)
- Docker Desktop
with-connectinstalled viauv tool install
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels