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 from the IDE.
I have my docker running properly from CLI.
These are error in the console:
ERROR DockerClientProviderStrategy Could not find a valid Docker environment. Please check configuration. Attempted configurations were:
ERROR DockerClientProviderStrategy UnixSocketClientProviderStrategy: failed with exception RuntimeException (java.lang.UnsatisfiedLinkError: Can't load library: /Users/<user>/Library/Caches/JNA/temp/jna16301762796732536306.tmp). Root cause UnsatisfiedLinkError (Can't load library: /Users/<user>/Library/Caches/JNA/temp/jna16301762796732536306.tmp)
ERROR DockerClientProviderStrategy UnixSocketClientProviderStrategy: failed with exception RuntimeException (java.lang.NoClassDefFoundError: Could not initialize class org.testcontainers.shaded.com.github.dockerjava.okhttp.UnixSocketFactory$1). Root cause NoClassDefFoundError (Could not initialize class org.testcontainers.shaded.com.github.dockerjava.okhttp.UnixSocketFactory$1)
ERROR DockerClientProviderStrategy As no valid configuration was found, execution cannot continue
Anyone has seen this before or has any idea for to debug it?
I'm new in Java env, any suggestion would be very appreciated! thanks
请先登录再写评论。
Most probably, one of the containers does not have arm version. See similar problem: https://stackoverflow.com/questions/72716456/java-lang-illegalstateexception-could-not-find-a-valid-docker-environment-plea
Thanks for your answer, yes it was due a JNA library that incompatible with apple arm.
Able to fix it by upgrading JNA to 5.8.0