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]: Could not connect to Ryuk when running Testcontainers in Docker Desktop on Mac OS #7036
I am running Mac OS 13.3.1, using Docker Desktop 4.19.0 (106363) and Testcontainers 1.18.1
When using the Cassandra Testcontainer in particular, on cassandraContainer.start(), I am still seeing the following Exception being thrown:
Caused by: java.lang.IllegalStateException: Could not connect to Ryuk at 172.17.0.1:59391
at org.testcontainers.utility.RyukResourceReaper.maybeStart(RyukResourceReaper.java:132)
at org.testcontainers.utility.RyukResourceReaper.init(RyukResourceReaper.java:42)
at org.testcontainers.DockerClientFactory.client(DockerClientFactory.java:224)
at org.testcontainers.DockerClientFactory$1.getDockerClient(DockerClientFactory.java:104)
at com.github.dockerjava.api.DockerClientDelegate.authConfig(DockerClientDelegate.java:109)
at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:321)
at example.app.crm.config.TestcontainersCassandraConfiguration.cassandraContainer(TestcontainersCassandraConfiguration.java:71)
...
/var/run/docker.sock.raw is not even a file on macOS 13.3.1 with Docker Desktop 4.19.0 (106363) using Testcontainers 1.18.1:
$ ls -la /var/run/docker.sock.raw
ls: /var/run/docker.sock.raw: No such file or directory
I still see:
Caused by: java.lang.IllegalStateException: Could not connect to Ryuk at 172.17.0.1:59391
at org.testcontainers.utility.RyukResourceReaper.maybeStart(RyukResourceReaper.java:132)
at org.testcontainers.utility.RyukResourceReaper.init(RyukResourceReaper.java:42)
at org.testcontainers.DockerClientFactory.client(DockerClientFactory.java:224)
at org.testcontainers.DockerClientFactory$1.getDockerClient(DockerClientFactory.java:104)
at com.github.dockerjava.api.DockerClientDelegate.authConfig(DockerClientDelegate.java:109)
at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:321)
at example.app.crm.config.TestcontainersCassandraConfiguration.cassandraContainer(TestcontainersCassandraConfiguration.java:71)
...
..
.
I am attempting to run tests using Testcontainers to bootstrap a Apache Cassandra 3.11.15 container with:
changed the title [-][Bug]: Could not connect to Ryuk when running Testcontainers in Docker Desktop[/-][+]Could not connect to Ryuk when running Testcontainers in Docker Desktop on Mac OS[/+]on May 13, 2023
changed the title [-]Could not connect to Ryuk when running Testcontainers in Docker Desktop on Mac OS[/-][+][Bug]: Could not connect to Ryuk when running Testcontainers in Docker Desktop on Mac OS[/+]on May 13, 2023
Hi, IIRC latest version of Docker Desktop doesn't provide /var/run/docker.sock by default. In order to enable it should go to Settings > Advanced and make sure Enable default Docker socket (Requires password) is checked.
Rootless is still not supported for Docker Desktop for Mac and Linux.
I have the same issue; I have an M1 mac with the Docker for desktop and the Docker socket is enabled and accessible in /var/run/docker.sock but I can't use test container 1.18.1 as it fails with the following error:
Could not find a valid Docker environment. Please check configuration.
Hi, IIRC latest version of Docker Desktop doesn't provide /var/run/docker.sock by default. In order to enable it should go to Settings > Advanced and make sure Enable default Docker socket (Requires password) is checked.
Rootless is still not supported for Docker Desktop for Mac and Linux.
Hope this help.
Testcontainers for Java 1.18.2 will auto-detect ~/.docker/run/docker.sock. So, no more workarounds are needed.
Activity
jxblum commentedon May 12, 2023
Copy from comment in Issue #4395.
/var/run/docker.sock.rawis not even a file on macOS13.3.1with Docker Desktop4.19.0 (106363)using Testcontainers1.18.1:I still see:
I am attempting to run tests using Testcontainers to bootstrap a Apache Cassandra
3.11.15container with:Essentially, bootstrapping the Cassandra container with:
[-][Bug]: Could not connect to Ryuk when running Testcontainers in Docker Desktop[/-][+]Could not connect to Ryuk when running Testcontainers in Docker Desktop on Mac OS[/+][-]Could not connect to Ryuk when running Testcontainers in Docker Desktop on Mac OS[/-][+][Bug]: Could not connect to Ryuk when running Testcontainers in Docker Desktop on Mac OS[/+]grv95 commentedon May 16, 2023
+1
Facing the same issue on Mac m1 arm64 machine.
eddumelendez commentedon May 16, 2023
Hi, IIRC latest version of Docker Desktop doesn't provide
/var/run/docker.sockby default. In order to enable it should go toSettings > Advancedand make sureEnable default Docker socket (Requires password)is checked.Rootless is still not supported for Docker Desktop for Mac and Linux.
Hope this help.
ph4r5h4d commentedon May 16, 2023
I have the same issue; I have an M1 mac with the Docker for desktop and the Docker socket is enabled and accessible in
/var/run/docker.sockbut I can't use test container 1.18.1 as it fails with the following error:The same thing works with 1.17.6
eddumelendez commentedon May 16, 2023
@ph4r5h4d can you share your logs? Also, this is a different issue I think. In the meantime, can we go move to discussion, please?
grv95 commentedon May 16, 2023
@eddumelendez
I already have the default docker socket enabled.
It is available for me as
/var/run/docker.sockinstead of/var/run/docker.sock.rawstill can't connect to Ryuk
Other containers are working fine.
eddumelendez commentedon May 30, 2023
Testcontainers for Java 1.18.2 will auto-detect
~/.docker/run/docker.sock. So, no more workarounds are needed.dreamawakening commentedon Jun 19, 2024
Has anyone figured out how to fix this error? I'm getting it on my M3 Pro device. When I set this env var, the exact same test succeeds:
upeter commentedon Aug 14, 2024
The only way I could get it solved on my M2 Pro is via
-e TESTCONTAINERS_HOST_OVERRIDE=host.docker.internal. Then it worked flawlessly.rdehuyss commentedon May 11, 2025
@upeter - thank you so much, this is a lifesaver.
TESTCONTAINERS_HOST_OVERRIDE=host.docker.internalmade it work also for me.TESTCONTAINERS_HOST_OVERRIDE=host.docker.internal для исправления зап…