-
-
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]: Can not connect to Ryuk at 172.17.0.1:61798: Connection refused #5857
Comments
Hi @adamjshook, |
Yes, we are using that feature. I changed it to use |
Hi @adamjshook, Here a sample code that would create the
@Test
public void testGetValue() {
final GenericContainer<?> ryukContainer = new GenericContainer<>("testcontainers/ryuk:0.3.4")
.withExposedPorts(8080)
.withCreateContainerCmdModifier(cmd -> {
cmd.withName("testcontainers-ryuk-" + DockerClientFactory.SESSION_ID);
cmd.withHostConfig(
cmd
.getHostConfig()
.withAutoRemove(true)
.withPrivileged(TestcontainersConfiguration.getInstance().isRyukPrivileged())
.withBinds(
new Bind(
DockerClientFactory.instance().getRemoteDockerUnixSocketPath(),
new Volume("/var/run/docker.sock")
)
)
);
})
.waitingFor(Wait.forLogMessage(".*Started.*", 1));
ryukContainer.start();
String host = ryukContainer.getHost();
Integer ryukPort = ryukContainer.getFirstMappedPort();
try (Socket clientSocket = new Socket()) {
clientSocket.connect(new InetSocketAddress(host, ryukPort), 5 * 1000);
} catch (Exception e) {
throw new IllegalStateException("Could not connect to Ryuk at " + host + ":" + ryukPort, e);
}
} |
I ran the provided code (with some additional logging) and in both cases the Ryuk container starts and the client attempts to connect at Logs from the test case: 1.17.3
1.15.3
|
I think you are running into this upstream issue: #4395 @hariohmprasath Thanks a lot for your supportt in triaging this issue 🙇 |
I tried the workaround of mounting |
@adamjshook Unfortunately I don't know what else we can do here, it probably requires more detailed debugging of the Docker environment. Did you verify that Can you please share your finding, that the workaround does not work for you in #4395? I will close this issue as a duplicate. |
I have the same issue with fresh colima installation and testcontainers-1.17.5. |
@bigunyak take a look at our documentation. Also, Testcontainers Desktop with embedded runtime works OOTB with Testcontainers |
@eddumelendez , starting colima with |
Module
Core
Testcontainers version
1.17.3
Using the latest Testcontainers version?
Yes
Host OS
Mac OS X
Host Arch
x86_64
Docker version
What happened?
Testcontainers is unable to connect to Ryuk after it starts. I would expect it to be able to connect and launch the additional containers.
Note I am using running tests using Testcontainers inside a Docker container on Mac OS. The Docker container runs a Maven build to run the tests. This same image to run the tests is used on the CI server which uses Linux (don't know which flavor) and the build succeeds.
The command is essentially:
Relevant log output
Additional Information
Setting
TESTCONTAINERS_RYUK_DISABLED=true
allows my test cases to pass. I do not experience this on previous version 1.15.3; the tests run as expected. I hit this issue starting in 1.16.0 and is still present in 1.16.3.The text was updated successfully, but these errors were encountered: