Problem
The address a container uses to reach the host depends on the container runtime:
| Runtime |
Platform |
Host address |
| Docker Desktop |
macOS/Windows |
host.docker.internal |
| Docker Engine |
Linux |
172.17.0.1 (bridge IP) or host.docker.internal if extra-hosts set |
| Podman rootless |
Linux |
10.0.2.2 (slirp4netns default) |
| Podman rootless |
macOS |
host.containers.internal |
| Podman rootful |
Linux |
10.88.0.1 (podman bridge) |
When injecting GATEWAY_URL (issue #19), nemesis8 must detect the runtime (already stored in DockerOps::runtime_binary) and platform to choose the right host address.
Fix
Add a gateway_host_address(runtime: &str) -> String helper in docker.rs that returns the correct host address. Use it when building GATEWAY_URL for spawned containers.
For Linux Docker without host.docker.internal, fall back to inspecting the container's default gateway via the Docker API or use --add-host=host.docker.internal:host-gateway in the run args.
Problem
The address a container uses to reach the host depends on the container runtime:
host.docker.internal172.17.0.1(bridge IP) orhost.docker.internalif extra-hosts set10.0.2.2(slirp4netns default)host.containers.internal10.88.0.1(podman bridge)When injecting
GATEWAY_URL(issue #19), nemesis8 must detect the runtime (already stored inDockerOps::runtime_binary) and platform to choose the right host address.Fix
Add a
gateway_host_address(runtime: &str) -> Stringhelper indocker.rsthat returns the correct host address. Use it when buildingGATEWAY_URLfor spawned containers.For Linux Docker without
host.docker.internal, fall back to inspecting the container's default gateway via the Docker API or use--add-host=host.docker.internal:host-gatewayin the run args.