Could not find a valid Docker environment. Please see logs and check configuration

See original GitHub issue

I have see similar issues here but I have not found a solution yet to my problem.

I would like to open a new thread here and see if if there is a clear solution for this. I am using testcontainers 1.15.3:

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.base/java.util.Optional.orElseThrow(Optional.java:408)
	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)
	at org.testcontainers.containers.GenericContainer.starting(GenericContainer.java:1029)
	at org.testcontainers.containers.FailureDetectingExternalResource$1.evaluate(FailureDetectingExternalResource.java:29)
	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
	at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
	at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:221)
	at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54)

Java 11 installed with homebrew: DK Runtime Environment (build 11.0.10+9) OpenJDK 64-Bit Server VM (build 11.0.10+9, mixed mode)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
JohnnyMarnellcommented, Sep 14, 2022

@bsideup @eddumelendez I’ve run into this again (last time was an old elasticsearch jar), this time the only JNA dep I see from mvn dependency:tree is from myProject => testcontainers:jar:1.17.3:compile => docker-java-transport-zerodep:jar:3.2.13:compile => jna:jar:4.5.2:compile. Confused why/how it’s getting a low version…

[INFO] +- org.testcontainers:testcontainers:jar:1.17.3:compile
[INFO] |  +- junit:junit:jar:4.12:compile
[INFO] |  +- org.slf4j:slf4j-api:jar:1.7.30:compile
[INFO] |  +- org.apache.commons:commons-compress:jar:1.16.1:compile
[INFO] |  +- org.rnorth.duct-tape:duct-tape:jar:1.0.8:compile
[INFO] |  |  \- org.jetbrains:annotations:jar:17.0.0:compile
[INFO] |  +- com.github.docker-java:docker-java-api:jar:3.2.13:compile
[INFO] |  \- com.github.docker-java:docker-java-transport-zerodep:jar:3.2.13:compile
[INFO] |     +- com.github.docker-java:docker-java-transport:jar:3.2.13:compile
[INFO] |     \- net.java.dev.jna:jna:jar:4.5.2:compile
2reactions
bsideupcommented, Apr 21, 2021

@cvetan Testcontainers works great with ARM JDKs (I am using M1 myself, btw). Just make sure that you have a version of JNA on classpath that supports M1 (some projects hard force JNA to old versions, for example. 5.7.0 and newer work great with M1).

Testcontainers 1.15.3 depends on JNA 5.8.0 transitively via docker-java 3.2.8. So, as long as your project isn’t doing something shady (e.g. forcing some old versions of transitive dependencies), you will be fine 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Test Container test cases are failing due to "Could not find a ...
IllegalStateException : Could not find a valid Docker environment. Please see logs and check configuration at org.testcontainers.dockerclient ...
Read more >
Error "Could not find a valid Docker environment ... - GitHub
Having "Could not find a valid Docker environment. " error what causes test flakiness ... Please see logs and check configuration java.lang.
Read more >
Could not find a valid Docker environment issue
Hi All, I have installed and setup IntelliJ on a new laptop (Mac M1). Currently the integration tests failed because can't run docker......
Read more >
General Docker requirements - Testcontainers for Java
These Docker environments are automatically detected and used by Testcontainers without any additional configuration being necessary.
Read more >
Docker-machine executable was not found on PATH while ...
... /usr/local/bin, /usr/sbin, /usr/bin, /sbin, /bin]) [ERROR] Could not find a valid Docker environment. Please check configuration.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found