testcontainers / testcontainers/testcontainers-java
testcontainers 1.12.2 and up does not replace versions from .env
Nessuno ha ancora preso questa issue.
- Lingua principale
- Java
- Stelle
- 8.7k
- Fork
- 1.9k
- Merge medio
- 2g 17h
- PR unite (30g)
- 9
Descrizione
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.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia dalla gestione del pull delle immagini di DockerComposeContainer e riproduci la configurazione segnalata con un segnaposto per la versione in docker-compose.yml e il relativo valore in .env. Confronta il comportamento tra testcontainers 1.12.1 e 1.12.5 e considera conclusa l’issue quando il segnaposto viene risolto in un riferimento a un’immagine valido durante i pull.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- docker, docker-compose, java
- Ambito
- testing
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100