Usage with testcontainers and jenkins in docker #138
-
Hi All - bit of a niche question - I'm looking to use testcontainers to create the Redis cluster. Locally I can configure my tests to talk to the cluster and everything works fine. The issue is that when the same tests are run on a build slave, the slave is itself a container. This means we need to use the docker wormhole pattern to access the container. Testcontainers provides a method (getHost) that correctly resolves the IP of the container running the cluster. The issue is that the cluster registers all nodes under 127.0.0.1 so when the test code attempts to make use of the cluster, the cluster tries to access nodes on 127.0.0.1 which is obviously wrong as it needs to communicate using the hostIp. I know this isn't specific to this image but don't suppose anyone has come across this before and knows how to resolve it? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
@ash-sykes-acn I dont know if it really solves the issue, but in 7.0-RC1 they changed this |
Beta Was this translation helpful? Give feedback.
-
If this helps anyone here is some, non productionised test code, for doing this with Lettuce (not Spring Data)
|
Beta Was this translation helpful? Give feedback.
-
Here is my solution for the test container to run with dynamic ports, use Redisson on Kotlin and tested with tag
|
Beta Was this translation helpful? Give feedback.
Here is my solution for the test container to run with dynamic ports, use Redisson on Kotlin and tested with tag
latest
: