Skip to content

Clarification working with WSL : Working with WSL docker installation with testcontainers complains on could not find docker enviornment #5054

Description

@gavasv

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;
    }

}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions