SIGN IN SIGN UP

feat(core): support SSH-based DOCKER_HOST (#993)

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
R
Roy Moore committed
d48115def127644964d4d2b09a38e3f4492cc43c
Parent: baa5668
Committed by GitHub <noreply@github.com> on 4/3/2026, 5:25:12 PM