title: Testcontainers DockerComposeContainer with Docker Compose version v2.0.0
body: <p>I'm trying to use testcontainers with a <code>DockerComposeContainer</code>. My docker-compose.yaml content is this:</p>
  <pre class="lang-yaml prettyprint-override"><code>version: '3.8'
  
  services:
    postgresql:
      image: postgres:13
      environment:
        POSTGRES_USER: ordering
        POSTGRES_PASSWORD: ordering
        POSTGRES_DB: ordering
  </code></pre>
  <p>I'm stating the container using the following spring-boot initializer code:</p>
  <pre class="lang-java prettyprint-override"><code>  static class Initializer implements ApplicationContextInitializer&lt;ConfigurableApplicationContext&gt; {
      @Override
      public void initialize(ConfigurableApplicationContext applicationContext) {
        DockerComposeContainer&lt;?&gt; environment = new DockerComposeContainer&lt;&gt;(DOCKER_COMPOSE_FILE)
            .withExposedService(DB_SERVICE_NAME, DB_PORT)
            .withLocalCompose(true)
            .start();
  }
  </code></pre>
  <p>This used to work until a recent update of docker-desktop on MacOS.</p>
  <p>Now it throws the following error:</p>
  <pre><code>Caused by: org.testcontainers.containers.ContainerLaunchException: Aborting attempt to link to container l2whc7cxqkzd_postgresql_1 as it is not running
      at org.testcontainers.containers.GenericContainer.applyConfiguration(GenericContainer.java:812)
      at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:363)
      ... 40 more
  </code></pre>
  <p>If I put a break point in the code before it throws the exception and check my running docker containers I see a container with name <code>l2whc7cxqkzd-postgresql-1</code>. The difference is the use of dashes instead of underscores in the name. I guess this a recent change in the docker-compose behaviour in regards to project-identifier separator.</p>
  <p>My question is, is there a way to use testcontainers with Docker Compose 2.0.0?</p>
  <p>My testcontainers dependency version is <code>1.16.0</code> and docker desktop version 4.1.0.</p>