You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

M3苹果电脑上使用Rancher Desktop运行TestContainers时出现Could not find a valid Docker environment错误的排查咨询

M3苹果电脑上使用Rancher Desktop运行TestContainers时出现Could not find a valid Docker environment错误的排查咨询

大家好,我在M3苹果电脑上用Rancher Desktop运行TestContainers时,碰到了「无法找到有效的Docker环境」的问题,折腾了一阵还是没解决,想请教下该怎么进一步排查?

我的环境详情:

  • Rancher版本:1.18.0
  • Kubernetes版本:1.31.5
  • 容器引擎:Moby
  • TestContainers版本:1.15.3
  • IntelliJ版本:Runtime version: 21.0.6+8-b631.39 aarch64 (JCEF 122.1.9), VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
  • MacOS版本:Sonoma(14.6)
  • JDK版本:openjdk version "17.0.14" 2025-01-21

JNA依赖树:

[INFO] - io.appform.testcontainer:junit-testcontainer-commons:jar:1.0.6:test
[INFO]    - org.testcontainers:testcontainers:jar:1.15.3:test
[INFO]       +- org.rnorth.visible-assertions:visible-assertions:jar:2.1.2:test
[INFO]       |  - net.java.dev.jna:jna:jar:5.2.0:test
[INFO]       - com.github.docker-java:docker-java-transport-zerodep:jar:3.2.8:test
[INFO]          - (net.java.dev.jna:jna:jar:5.8.0:test - omitted for conflict with 5.2.0)

已经尝试过的操作:

我试过了相关的排查方案,但问题依然存在。

报错日志:

2025-02-25 21:55:47.004 INFO  o.t.d.DockerMachineClientProviderStrategy:58 - docker-machine executable was not found on PATH ([/Users/amrit.anand/.rd/bin, /Users/amrit.anand/.rd/bin, /opt/homebrew/bin, /opt/homebrew/sbin, /usr/local/bin, /System/Cryptexes/App/usr/bin, /usr/bin, /bin, /usr/sbin, /sbin, /var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin, /var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin, /var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin])
2025-02-25 21:55:52.107 ERROR o.t.d.DockerClientProviderStrategy:208 - Could not find a valid Docker environment. Please check configuration. Attempted configurations were:
2025-02-25 21:55:52.108 ERROR o.t.d.DockerClientProviderStrategy:210 -     UnixSocketClientProviderStrategy: failed with exception RuntimeException (java.lang.UnsatisfiedLinkError: /Users/amrit.anand/Library/Caches/JNA/temp/jna9558949929743584872.tmp: dlopen(/Users/amrit.anand/Library/Caches/JNA/temp/jna9558949929743584872.tmp, 0x0001): tried: '/Users/amrit.anand/Library/Caches/JNA/temp/jna9558949929743584872.tmp' (fat file, but missing compatible architecture (have 'i386,x86_64', need 'arm64e' or 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/amrit.anand/Library/Caches/JNA/temp/jna9558949929743584872.tmp' (no such file), '/Users/amrit.anand/Library/Caches/JNA/temp/jna9558949929743584872.tmp' (fat file, but missing compatible architecture (have 'i386,x86_64', need 'arm64e' or 'arm64'))). Root cause UnsatisfiedLinkError (/Users/amrit.anand/Library/Caches/JNA/temp/jna9558949929743584872.tmp: dlopen(/Users/amrit.anand/Library/Caches/JNA/temp/jna9558949929743584872.tmp, 0x0001): tried: '/Users/amrit.anand/Library/Caches/JNA/temp/jna9558949929743584872.tmp' (fat file, but missing compatible architecture (have 'i386,x86_64', need 'arm64e' or 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/amrit.anand/Library/Caches/JNA/temp/jna9558949929743584872.tmp' (no such file), '/Users/amrit.anand/Library/Caches/JNA/temp/jna9558949929743584872.tmp' (fat file, but missing compatible architecture (have 'i386,x86_64', need 'arm64e' or 'arm64')))
2025-02-25 21:55:52.109 ERROR o.t.d.DockerClientProviderStrategy:210 -     UnixSocketClientProviderStrategy: failed with exception RuntimeException (java.lang.NoClassDefFoundError: Could not initialize class com.github.dockerjava.transport.DomainSocket). Root cause ExceptionInInitializerError (Exception java.lang.UnsatisfiedLinkError: /Users/amrit.anand/Library/Caches/JNA/temp/jna9558949929743584872.tmp: dlopen(/Users/amrit.anand/Library/Caches/JNA/temp/jna9558949929743584872.tmp, 0x0001): tried: '/Users/amrit.anand/Library/Caches/JNA/temp/jna9558949929743584872.tmp' (fat file, but missing compatible architecture (have 'i386,x86_64', need 'arm64e' or 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/amrit.anand/Library/Caches/JNA/temp/jna9558949929743584872.tmp' (no such file), '/Users/amrit.anand/Library/Caches/JNA/temp/jna9558949929743584872.tmp' (fat file, but missing compatible architecture (have 'i386,x86_64', need 'arm64e' or 'arm64')) [in thread "ducttape-0"])
2025-02-25 21:55:52.109 ERROR o.t.d.DockerClientProviderStrategy:212 - As no valid configuration was found, execution cannot continue

想请教下各位,我该怎么进一步排查这个问题呢?

备注:内容来源于stack exchange,提问作者Amrit Anand

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.14 11:28:07