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
Clarification working with WSL : Working with WSL docker installation with testcontainers complains on could not find docker enviornment #5054
Below error appears when i run my integration tests through WSL docker.
Error : Caused by: java.lang.IllegalStateException: Could not find a valid Docker environment. Please see logs and check configuration
at org.testcontainers.dockerclient.DockerClientProviderStrategy.lambda$getFirstValidStrategy$4(DockerClientProviderStrategy.java:156)
Note : Integration tests are able to find docker environment when I have have docker desktop/docker installation on windows machine.
Any hints on how to run these with intellij + WSL would be appreciated.
More info on the way I create container :
{
private static final DockerImageName COUCHBASE_IMAGE = DockerImageName.parse("couchbase/server:7.0.0");
public static final String USERNAME = "admin";
public static final String PASSWORD = "admin1";
public static final String BUCKET_NAME = "designer";
public static class CouchbaseContainerStartable extends CouchbaseContainer {
public CouchbaseContainerStartable(DockerImageName dockerImageName) {
super(dockerImageName);
}
public CouchbaseContainer startCouchbase() {
super.start();
configureBucketScope();
configureBucketCollection();
return this;
}
Hello @kiview,
To briefly describe what I want to achieve, and the history behind these questions.
we had developed an integration test suite which was working on the docker desktop.
Docker desktop is now replaced with WSL, so I could run integration tests with containers.
Now, I want to run integration test cases WSL + intellij on windows machines which gives me error about unable to find docker environment. I would like our developers to work with intellij windows wsl and have ability to run integration tests from intellij.
I hope you got my problem statement, let me know if more info is needed.
Activity
gavasv commentedon Feb 22, 2022
@daschl @kiview
Any suggestions on this topic ??
kiview commentedon Feb 22, 2022
Testcontainers works OOTB with Docker Desktop on Windows and the now default WSL2 backend. Please share more details about your setup and logs.
I also don't understand why you subclass
CouchbaseContainerlike this. Please verify a working Testcontainers environment by trying out our simple reproducer:https://github.com/testcontainers/testcontainers-java-repro
@daschl This is unrelated to
CouchbaseContainer.gavasv commentedon Feb 22, 2022
Hello @kiview,
To briefly describe what I want to achieve, and the history behind these questions.
Now, I want to run integration test cases WSL + intellij on windows machines which gives me error about unable to find docker environment. I would like our developers to work with intellij windows wsl and have ability to run integration tests from intellij.
I hope you got my problem statement, let me know if more info is needed.
Thanks Vishal
kiview commentedon Feb 22, 2022
On Windows Testcontainers only supports Docker Desktop officially.
If you run your tests from within WSL with Docker running in WSL, Testcontainers should work OOTB.
For making Testcontainers work from the Windows host with a Docker daemon running inside WSL, make sure you configure the Docker daemon to be accessible by the Windows host and configure Testcontainers for a remote Docker daemon connection:
https://www.testcontainers.org/features/configuration/#customizing-docker-host-detection
I will convert this issue into a GH Discussion question.