I am trying to run testcontainers with rootless docker in Linux. The only problem now is that ryuk is not working, due to hardcoded path to the unix domain socket in ResourceReaper.java . The value from DOCKER_HOST environment variable should be used, if possible.
For example, in my case DOCKER_HOST=unix:///var/run/user/1000/docker.sock
By changing the line from
binds.add(new Bind("/var/run/docker.sock", new Volume("/var/run/docker.sock")));
to
binds.add(new Bind("/var/run/user/1000/docker.sock", new Volume("/var/run/docker.sock")));
in ResourceReaper.java, then ryuk is working correctly.
This issue was already raised in closed issue #862 , which had a pull request but was not merged.
If this is difficult to fix in general, how about just adding the possibility to override the harcoded value by using a property / environment variable ?