You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixes#992
## Problem
When `DOCKER_HOST` is set to an SSH URL (e.g. `ssh://user@remote-host`),
the Docker Python SDK rewrites `base_url` to `http+docker://ssh`, losing
the original hostname. This causes `DockerClient.host()` to return
`"ssh"` instead of the actual remote address, breaking container
connectivity.
Additionally, the SDK defaults to paramiko for SSH connections, which
crashes under pytest due to stdin capture conflicts.
## Changes
### `docker_client.py`
- Extract the remote hostname from `DOCKER_HOST` in `host()` instead of
relying on the SDK's rewritten `base_url`
- Default to `use_ssh_client=True` for SSH connections to avoid
paramiko/pytest stdin conflicts
- Sanitize SSH URLs with unsupported path components before passing to
the SDK
- Add `get_docker_host_hostname()` and `is_ssh_docker_host()` helpers
### `compose.py`
- Handle SSH in `PublishedPortModel.normalize()` — replace local bind
addresses (`0.0.0.0`, `127.0.0.1`, etc.) with the remote SSH hostname
### Tests
- Add SSH-specific tests for `DockerClient.host()`, connection mode,
compose port normalization, and URL sanitization
0 commit comments