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
Client: Docker Engine - Community
Version: 26.0.0
API version: 1.45
Go version: go1.21.8
Git commit: 2ae903e
Built: Wed Mar 20 15:18:01 2024
OS/Arch: linux/amd64
Context: default
Server: Docker Engine - Community
Engine:
Version: 26.0.0
API version: 1.45 (minimum version 1.24)
Go version: go1.21.8
Git commit: 8b79278
Built: Wed Mar 20 15:18:01 2024
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.6.28
GitCommit: ae07eda36dd25f8a1b98dfbf587313b99c0190bb
runc:
Version: 1.1.12
GitCommit: v1.1.12-0-g51d5e94
docker-init:
Version: 0.19.0
GitCommit: de40ad0
rootlesskit:
Version: 2.0.2
ApiVersion: 1.1.1
NetworkDriver: slirp4netns
PortDriver: builtin
StateDir: /run/user/1000/dockerd-rootless
slirp4netns:
Version: 1.2.1
GitCommit: 09e31e92fa3d2a1d3ca261adaeb012c8d75a8194
What happened?
I have a docker compose file which contains a variable substitution (${VAR}). A DockerComposeContainer is created to use the compose file and set the variable a withEnv-call. This works fine, but as soon the stop is called, an Exception is thrown due to an error (IllegalStateException: Container did not start correctly.).
NetworkcontainerNetwork = Network.newNetwork()
DockerComposeContainercomposeContainer = newDockerComposeContainer("compose-file.yaml")
.withExposedService("mock", 8080)
.withExposedService("db", 5432)
.withEnv("NETWORK", containerNetwork.getId());
composeContainer.start();
// .... everything fine until now// the following stop will raise the excpeption, because inside of DockerComposeContainer#stop the env is not passed to the composeDelegatecomposeContainer.stop();
Relevant log output
Caused by: org.testcontainers.containers.ContainerLaunchException: Container startup failed for image docker/compose:1.29.2
at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:359)
at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:330)
at org.testcontainers.containers.ContainerisedDockerCompose.invoke(ContainerisedDockerCompose.java:64)
at org.testcontainers.containers.ComposeDelegate.runWithCompose(ComposeDelegate.java:254)
at org.testcontainers.containers.ComposeDelegate.runWithCompose(ComposeDelegate.java:240)
at org.testcontainers.containers.DockerComposeContainer.stop(DockerComposeContainer.java:175)
at my.custom.DockerComposeResource.stop(DockerComposeResource.java:142)
at io.quarkus.test.common.TestResourceManager.close(TestResourceManager.java:177)
... 49 more
Caused by: org.rnorth.ducttape.RetryCountExceededException: Retry limit hit with exception
at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:88)
at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:344)
... 56 more
Caused by: org.testcontainers.containers.ContainerLaunchException: Could not create/start container
at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:563)
at org.testcontainers.containers.GenericContainer.lambda$doStart$0(GenericContainer.java:354)
at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:81)
... 57 more
Caused by: java.lang.IllegalStateException: Container did not start correctly.
at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:495)
... 59 more
Additional Information
I have a fix prepared and will open a PR.
The text was updated successfully, but these errors were encountered:
This fixes issues on stopping when ENV-Variables are used inside the compose file.
Issue was introduced in 7112db5.
Fixestestcontainers#8492
Signed-off-by: Michael Musenbrock <michael.musenbrock@gmail.com>
mmusenbr
added a commit
to mmusenbr/testcontainers-java
that referenced
this issue
Mar 27, 2024
This fixes issues on stopping when ENV-Variables are used inside the compose file.
Issue was introduced in 7112db5.
Fixestestcontainers#8492
Signed-off-by: Michael Musenbrock <michael.musenbrock@gmail.com>
This issue was introduced in 7112db5. `DockerComposeContainer` and
`ComposeContainer` now passes the env to the stop command in both
implementations.
Fixes#8492
---------
Signed-off-by: Michael Musenbrock <michael.musenbrock@gmail.com>
Co-authored-by: Eddú Meléndez Gonzales <eddu.melendez@gmail.com>
Module
Core
Testcontainers version
1.19.7
Using the latest Testcontainers version?
Yes
Host OS
Linux Debian/sid
Host Arch
amd64
Docker version
What happened?
I have a docker compose file which contains a variable substitution (${VAR}). A DockerComposeContainer is created to use the compose file and set the variable a withEnv-call. This works fine, but as soon the stop is called, an Exception is thrown due to an error (IllegalStateException: Container did not start correctly.).
Relevant log output
Additional Information
I have a fix prepared and will open a PR.
The text was updated successfully, but these errors were encountered: