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
When trying to run a test with testcontainer, there's an error: Could not find a valid Docker environment
After spending a long time trying to debug the issue we found out that it's because Docker doesn't create a docker.sock at /var/run by default anymore. That behaviour is since 4.13.0 and is documented in the release notes
We were able to fix the problem by manually creating a symlink: sudo ln -s $HOME/.docker/run/docker-cli.sock /var/run/docker-cli.sock
I'm opening this issue to bring awareness to the problem. You could
Update the documentation, and the error message, to inform people this symlink is now needed
Point UnixSocketClientProviderStrategy to the new location of the socket ($HOME/.docker/run)
Do anything else 😁
I hope that's helpful, if not feel free to close 👍
Best,
Flo
Note: I could not update the version of test-containers (working on a client project), but I don't think it's version related as it's still present in the current main. If I'm mistaken and the bug has been fixed already, sorry for the false alert 🙂
Relevant log output
Could not find a valid Docker environment. Please see logs and check configuration
java.lang.IllegalStateException: Could not find a valid Docker environment. Please see logs and check configuration
at org.testcontainers.dockerclient.DockerClientProviderStrategy.lambda$getFirstValidStrategy$7(DockerClientProviderStrategy.java:215)
at java.util.Optional.orElseThrow(Optional.java:290)
at org.testcontainers.dockerclient.DockerClientProviderStrategy.getFirstValidStrategy(DockerClientProviderStrategy.java:207)
at org.testcontainers.DockerClientFactory.getOrInitializeStrategy(DockerClientFactory.java:136)
at org.testcontainers.DockerClientFactory.client(DockerClientFactory.java:178)
at org.testcontainers.LazyDockerClient.getDockerClient(LazyDockerClient.java:14)
at org.testcontainers.LazyDockerClient.authConfig(LazyDockerClient.java:12)
at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:310)
...
Additional Information
No response
The text was updated successfully, but these errors were encountered:
Hi @FlorianKempenich! We updated our docs properly, you can see it here. We also had a discussion and was properly answered. Also, looks like the change is going to be back to Docker Desktop, see comment.
Module
MySQL
Testcontainers version
1.15.3
Using the latest Testcontainers version?
No
Host OS
Mac OS
Host Arch
x86
Docker version
What happened?
When trying to run a test with testcontainer, there's an error:
Could not find a valid Docker environment
After spending a long time trying to debug the issue we found out that it's because Docker doesn't create a
docker.sock
at/var/run
by default anymore. That behaviour is since 4.13.0 and is documented in the release notesWe were able to fix the problem by manually creating a symlink:
sudo ln -s $HOME/.docker/run/docker-cli.sock /var/run/docker-cli.sock
I'm opening this issue to bring awareness to the problem. You could
UnixSocketClientProviderStrategy
to the new location of the socket ($HOME/.docker/run
)I hope that's helpful, if not feel free to close 👍
Best,
Flo
Relevant log output
Additional Information
No response
The text was updated successfully, but these errors were encountered: