testcontainers-java: getTestHostIpAddress is not possible under Docker for Mac beta
Current Docker for Mac beta does not provide an easy mechanism for establishing the host machine’s IP address. This means that getTestHostIpAddress cannot function.
Users can use a simple workaround, but I’d like to find a better solution to this.
This post, among others, describes the issue and some proposed workarounds.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 6
- Comments: 15 (7 by maintainers)
Sorry for letting this issue remain open for so long. There is a feature in 1.9.0 that makes connections from containers to the host vastly easier, and in a way that works regardless of the machine it is run on.
Please see the release notes for 1.9.0.
Instead of obtaining a host IP address, the supported way is now to use this
exposeHostPortsfeature. Please give it a try if you can!IMHO, it’s just an expected case to try to reach host machine from test containers e.g for Selenium Web Driver testing. The documentation also supports this idea. It shows a getHostIpAddress method. Was this an existing feature that was removed? https://www.testcontainers.org/usage/webdriver_containers.html
Hi @drichelson,
We know about the workaround, but unfortunately, it’s not that easy as you say 😃
.localhostand.localsuffixes 😄PR is always welcome, but please keep in mind all these nuances
Hey @rnorth, I’m wondering what’s the status of this issue?