fix(test-tooling): macOS ledger containers unreachable on the IP layer #186
Labels
bug
Something isn't working
dependencies
Pull requests that update a dependency file
Developer_Experience
Describe the bug
Can't ping containers through their own IP address (e.g. non-localhost IP).
The solution I've come up with on a feature branch for @jweate is to bind to port 0 via the
-P
parameter (publish all ports) of Docker container creation. This allows for multiple containers to co-exist just listen on different ports (and we can find out which ports got assigned on a per container basis which is a slight added complexity but at least this way it works).Ideally all the *TestLedger classes should be refactored so that they apply the workaround explained in the above paragraph.
To Reproduce
I pull up a test ledger, let's say a
BesuTestLedger
on macOS and try to ping the IP address that docker has assigned to the container.The pinging fails because of some deficiency of macOS virtualization/networking stack.
Expected behavior
I'd want to be able to reach the docker containers through their dedicated IP address so that I don't have to bind ports to the host's ports. I want to avoid the latter because the hosts ports are a shared resource and disallows me from running multiple containers of the same image in parallel.
Operating system name, version, build:
macOS, all versions AFAIK
Hyperledger Cactus release version or commit (git rev-parse --short HEAD):
All recent versions that have the test ledger classes in them.
Additional context
More info here: https://stackoverflow.com/a/39217691/698470
cc: @jweate @jonathan-m-hamilton @sfuji822 @sownak @takeutak
The text was updated successfully, but these errors were encountered: