title: The KafkaContainer in TestContainers hangs till timeout with "Timed out waiting for container port to open"
body: <p>I am trying to start a kafka container in TestContainers.
  My code is looking like this:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>import java.io.File;
  import java.time.Duration;
  import org.junit.jupiter.api.Test;
  import org.testcontainers.containers.DockerComposeContainer;
  import org.testcontainers.containers.KafkaContainer;
  import org.testcontainers.containers.PostgreSQLContainer;
  import org.testcontainers.containers.wait.strategy.Wait;
  import org.testcontainers.junit.jupiter.Container;
  import org.testcontainers.junit.jupiter.Testcontainers;
  
  @Testcontainers
  public class FirstTest {
  
    @Container
    public static DockerComposeContainer environment =
        new DockerComposeContainer(new File("src/test/resources/compose-test.yml"))
            .withExposedService(
                "redis_1", 6379, Wait.forListeningPort().withStartupTimeout(Duration.ofSeconds(60)));
  
    @Container
    public static KafkaContainer kafka =
        new KafkaContainer()
            .waitingFor(Wait.forListeningPort().withStartupTimeout(Duration.ofSeconds(360)));
  
    @Container public PostgreSQLContainer postgresContainer = new PostgreSQLContainer();
  
    @Test
    void integrationTest() {
  
      String redisUrl =
          environment.getServiceHost("redis_1", 6379)
              + ":"
              + environment.getServicePort("redis_1", 6379);
  
      String jdbcUrl = postgresContainer.getJdbcUrl();
      String username = postgresContainer.getUsername();
      String password = postgresContainer.getPassword();
  
      String url = kafka.getBootstrapServers();
    }
  }</code></pre>
  </div>
  </div>
  </p>
  <p>When I run this code the thread hangs in running state until I receive a timeout exception:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>Caused by: org.testcontainers.containers.ContainerLaunchException: Timed out waiting for container port to open (localhost ports: [32937, 32939] should be listening)</code></pre>
  </div>
  </div>
  </p>
  <p>I want to mention that without the kafkaContainer everything works as expected. I am able to start the redis and postgres containers succesfully.</p>
  <p>This is the kafkaContainer version which I use:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;dependency&gt;
        &lt;groupId&gt;org.testcontainers&lt;/groupId&gt;
        &lt;artifactId&gt;kafka&lt;/artifactId&gt;
        &lt;version&gt;1.14.3&lt;/version&gt;
        &lt;scope&gt;test&lt;/scope&gt;
   &lt;/dependency&gt;</code></pre>
  </div>
  </div>
  </p>