Commit graph

1 commit

Author SHA1 Message Date
octo-patch
1c245ee19c fix: resolve host IP from Docker bridge network for Rancher Desktop compatibility (fixes #561)
`--add-host host.docker.internal:host-gateway` works on Docker Desktop
and standard Docker Engine but not on Rancher Desktop, where the
`host-gateway` keyword is not recognised.

Introduce `_get_host_ip()` which reads the gateway of the Docker bridge
network (e.g. 172.17.0.1) — a portable, concrete IP that works across
Docker Desktop, Docker Engine, and Rancher Desktop.  If the network
inspect fails for any reason the function falls back to `host-gateway`,
preserving the existing behaviour for standard installations.

Also add unit tests covering the success path, subprocess failure, and
empty-output fallback.
2026-04-17 11:48:57 +08:00