You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Unable to override Docker Image via testcontainers.properties when using ComposeContainer #9222
I am attempting to override the default Docker Image version used in ComposeContainer by specifying a custom image version via compose.container.image in testcontainers.properties. However, the override does not seem to take effect and the container still uses the default version which is 24.0.2.
testcontainers.properties file:
compose.container.image=docker:25.0.2
Relevant log output
08:16:41.871 [main] INFO tc.docker:24.0.2 -- Creating container for image: docker:24.0.2
Based on an initial view I see the issue at ComposeContainer as the constructor creates a compose delegate based on the DEFAULT_IMAGE_NAME instead of checking if we have a property override.
public ComposeContainer(String identifier, List<File> composeFiles) {
this.composeDelegate =
new ComposeDelegate(
ComposeDelegate.ComposeVersion.V2,
composeFiles,
identifier,
COMPOSE_EXECUTABLE,
DEFAULT_IMAGE_NAME
);
this.project = this.composeDelegate.getProject();
}
Activity
fokion commentedon Sep 21, 2024
I can have a look if you want @eddumelendez
fokion commentedon Sep 21, 2024
Based on an initial view I see the issue at
ComposeContaineras the constructor creates a compose delegate based on theDEFAULT_IMAGE_NAMEinstead of checking if we have a property override.fokion commentedon Sep 21, 2024
@eddumelendez feel free to review on this one :)
eddumelendez commentedon Oct 17, 2024
Hi, the approach we would like to follow is
Log warning if
withLocal(true)is used in conjunction with custom image name (since image would not be used)Consider changes in DockerComposeContainer as well
This way the implementation aligns with other modules.
fokion commentedon Oct 18, 2024
Do you want to assign it to me?
juliojgd commentedon Jan 16, 2025
Hi @eddumelendez @fokion , is anybody already working on this?
fokion commentedon Jan 16, 2025
I am still waiting to either assign it to me or if it is lower in priority do something else... :)
eddumelendez commentedon Jan 16, 2025
@fokion the issue is yours
fokion commentedon Jan 17, 2025
will have a look this weekend and update based on your comments
fokion commentedon Jan 21, 2025
I updated the old pr to have some new commits based on the feedback on constructors.
viktorgt commentedon Mar 31, 2025
Any news on this?
m4rii0 commentedon Apr 2, 2025
Hello, @fokion and @eddumelendez it would be great to support the
DEFAULT_IMAGE_NAMEtestcontainers-java/core/src/main/java/org/testcontainers/containers/ComposeContainer.java
Line 64 in 55f2347
in the
CONTAINER_MAPPINGmaptestcontainers-java/core/src/main/java/org/testcontainers/utility/TestcontainersConfiguration.java
Lines 74 to 87 in 55f2347
So anyone can override this option if needed :), what do you guys think about it?
Add support for specifying Docker image in DockerComposeContainer and…