Skip to content

Usage with testcontainers and jenkins in docker #138

Answered by dkthezero
ash-sykes-acn asked this question in Q&A
Discussion options

You must be logged in to vote

Here is my solution for the test container to run with dynamic ports, use Redisson on Kotlin and tested with tag latest:

  1. Create Container
class RedisClusterContainer<SelfT : RedisClusterContainer<SelfT>> @JvmOverloads constructor(
  imageName: String = "grokzen/redis-cluster:latest"
) : GenericContainer<SelfT>(imageName) {
  companion object {
    val ports = listOf(
      HttpTestUtils.findRandomOpenPort(),
      HttpTestUtils.findRandomOpenPort(),
      HttpTestUtils.findRandomOpenPort(),
      HttpTestUtils.findRandomOpenPort(),
      HttpTestUtils.findRandomOpenPort(),
      HttpTestUtils.findRandomOpenPort(),
    ).toTypedArray()
    const val local = "0.0.0.0"
    val environments…

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
5 replies
@dcole-gsn
Comment options

@Grokzen
Comment options

@dcole-gsn
Comment options

@dcole-gsn
Comment options

@Grokzen
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Grokzen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants