-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Cannot reuse containers due to "endpoint with name XYZ already exists in network bridge" #7335
Labels
Comments
Can you share your setup, please? |
Not sure what else do you need. This is how I start container (using singleton pattern):
|
Same issue here. Do you have any progress? |
I have got the same problem public class PostgreSqlContainerWrapper extends PostgreSQLContainer<PostgreSqlContainerWrapper> {
private static final String IMAGE_VERSION = "postgres:11.1";
private static PostgreSqlContainerWrapper container;
private PostgreSqlContainerWrapper() {
super(IMAGE_VERSION);
}
static PostgreSqlContainerWrapper getInstance() {
if (container == null) {
container = new PostgreSqlContainerWrapper()
.withExposedPorts(POSTGRESQL_PORT)
.withPassword("test")
.withUsername("test")
.withDatabaseName("test")
.withAccessToHost(true)
.withReuse(true);
container.start();
}
return container;
}
@Override
public void start() {
super.start();
}
@Override
public void stop() {
//do nothing, JVM handles shut down
}
@Override
public void close() {
container.close();
}
} I have also testcontainer.properties file in $HOME
|
This was referenced Nov 7, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Module
Core
Testcontainers version
1.18.3
Using the latest Testcontainers version?
Yes
Host OS
MacOS
Host Arch
x86
Docker version
Client: Version: 24.0.2-rd API version: 1.42 (downgraded from 1.43) Go version: go1.20.4 Git commit: e63f5fa Built: Fri May 26 16:39:47 2023 OS/Arch: darwin/amd64 Context: default Server: Engine: Version: 23.0.6 API version: 1.42 (minimum version 1.12) Go version: go1.20.4 Git commit: 9dbdbd4b6d7681bd18c897a6ba0376073c2a72ff Built: Fri May 12 13:54:36 2023 OS/Arch: linux/amd64 Experimental: false containerd: Version: v1.7.0 GitCommit: 1fbd70374134b891f97ce19c70b6e50c7b9f4e0d runc: Version: 1.1.7 GitCommit: 860f061b76bb4fc671f0f9e900f7d80ff93d4eb7 docker-init: Version: 0.19.0 GitCommit:
What happened?
In my integration test I am using KafkaContainer with reuse enabled. I have reuse enabled also in my user directory (~/.testcontainers.properties). When I run test for the first time they work fine - container starts and tests pass. However, when I try to run test next time I get te following error:
In order to fix that I have to remove running containers and run test once again.
Relevant log output
Additional Information
No response
The text was updated successfully, but these errors were encountered: