GenericContainer::getHost()
returns misleading values across platforms
#1
Labels
bug
Something isn't working
When running on MacOS with Docker Desktop for Mac
getHost()
returns an IP address of the Docker host which is running inside a managed VM. This IP address is not routable from MacOS, so tests fail with timeouts.My understanding of
getHost
is that it should return the host at which ports are being exposed, which on MacOS should belocalhost
.The Ruby implementation roughly does the following:
TC_HOST
if it is presentDOCKER_HOST
orDOCKER_URL
are set but not parsable as a URL, uselocalhost
DOCKER_HOST
orDOCKER_URL
are set and use a network schema (tcp
orhttp*
), use the host portion of that URLDOCKER_HOST
is not set (so would default to local), or is set to a local schema (unix
ornpipe
):/.dockerenv
), use the default gatewaylocalhost
It'd be worth discussing whether that's the same route we should go with in PHP
The text was updated successfully, but these errors were encountered: