Testcontainers-java: Testcontainers downloads too much images

Created on 7 Oct 2020  路  4Comments  路  Source: testcontainers/testcontainers-java

I have the following code in my Spock test:

  def setupSpec() {
    collector = new GenericContainer<>("otel/opentelemetry-collector-dev")
      .dependsOn(backend)
      .withNetwork(network)
      .withNetworkAliases("collector")
      .withLogConsumer(new Slf4jLogConsumer(logger))
      .withCopyFileToContainer(MountableFile.forClasspathResource("/otel.yaml"), "/etc/otel.yaml")
      .withCommand("--config /etc/otel.yaml")
    collector.start()
  }

It used to work fine. Recently I upgraded testcontainers to version 1.15.0-rc2 and my GitHub action started to fail. It turns out that test has download ALL versions of otel/opentelemetry-collector-dev that are available. All 200+ of them.

I am able to reproduce this issue locally as well. I removed all local otel/opentelemetry-collector-dev images, ran the test and I already have 60 versions of them :) And test is still running.

resolutioacknowledged typbug

All 4 comments

@iNikem could you please share which version you used before 1.15.0-rc2? Perhaps you can find out which version introduced this (obviously faulty) behaviour?

1.14.3

Ouch, sorry for this. I think I know what this is likely to be caused by, and will look into it ASAP.

As a workaround, if you want the latest image, please could you explicitly include :latest in the image name?

As a workaround, if you want the latest image, please could you explicitly include :latest in the image name?

Yes, it works nicely when adding :latest

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aniketbhatnagar picture aniketbhatnagar  路  3Comments

micheal-swiggs picture micheal-swiggs  路  4Comments

naderghanbari picture naderghanbari  路  3Comments

lovepoem picture lovepoem  路  3Comments

dabraham02124 picture dabraham02124  路  3Comments