Skip to content

testcontainers 1.12.2 and up does not replace versions from .env #2309

Description

@leCandas

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions