testcontainers / testcontainers/testcontainers-java

testcontainers 1.12.2 and up does not replace versions from .env

Offen
#2,309 9 Kommentare 10 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

area/docker-compose resolution/acknowledged
Vorherrschende Sprache
Java
Sterne
8.7k
Forks
1.9k
Ø Merge
2 T. 17 Std.
Gemergte PRs (30 T.)
9

Beschreibung

Hello,

In a couple of projects we were using test containers version 1.12.1 with local-compose and pull enabled.
I have tried to update to testcontainers 1.12.5 however I have start to some errors on my console.

We are using single file docker-compose.yml version 2 and all image versions inside the compose configuration are coming from .env file
In docker-compose.yml we have mysql image with version placeholder
image: eu-west-1.amazonaws.com/content-delivery/mysql:${mysqlversion}
In .env file we have the version for placeholder
mysqlversion=1.0.0-SNAPSHOT

with this configuration, I start to see the errors below.

ERROR c.g.d.c.async.ResultCallbackTemplate - Error during callback com.github.dockerjava.api.exception.BadRequestException: {"message":"invalid reference format"}
	at org.testcontainers.dockerclient.transport.okhttp.OkHttpInvocationBuilder.execute(OkHttpInvocationBuilder.java:277)
	at org.testcontainers.dockerclient.transport.okhttp.OkHttpInvocationBuilder.lambda$executeAndStream$3(OkHttpInvocationBuilder.java:303)
	at java.lang.Thread.run(Thread.java:748)

WARN  o.t.c.DockerComposeContainer - Failed to pull image 'eu-west-1.amazonaws.com/content-delivery/mysql:${mysqlversion}'. Exception message was {"message":"invalid reference format"}

If I put version instead of the placeholder all works fine.
Before the update, we were using 1.12.1 version and that version does not have any problems with this type of configuration.

So, basically this is an issue with the current version.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne bei der Image-Pull-Behandlung von DockerComposeContainer und reproduziere das gemeldete Setup mit einem Versionsplatzhalter in docker-compose.yml und seinem Wert in .env. Vergleiche das Verhalten zwischen testcontainers 1.12.1 und 1.12.5 und betrachte das Issue als erledigt, wenn der Platzhalter während der Pulls zu einer gültigen Image-Referenz aufgelöst wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
docker, docker-compose, java
Bereich
testing
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.