无法连接到 Ryuk?

Unable to connect to Ryuk?

您好,我正在尝试从我的单元测试中启动一个测试容器 class。

根据我的测试 class 我正在使用以下内容

   @Container
    private static GenericContainer<?> testContainer =  new GenericContainer<>(TEST_IMAGE)
            .withCommand("sleep infinity")
//            .withLogConsumer(LOG_CONSUMER)
            .withNetwork(dockerNetwork).withNetworkAliases(TESTCONTAINER_NETWORK_ALIAS);

然而,当我 运行 我的测试时,我得到以下错误

SEVERE: Caught exception while closing extension context: org.junit.jupiter.engine.descriptor.ClassExtensionContext@495ee280
java.lang.IllegalStateException: Could not connect to Ryuk at 172.17.0.1:4750
        at org.testcontainers.utility.ResourceReaper.start(ResourceReaper.java:227)
        at org.testcontainers.DockerClientFactory.client(DockerClientFactory.java:219)
        at org.testcontainers.DockerClientFactory.getDockerClient(DockerClientFactory.java:101)
        at com.github.dockerjava.api.DockerClientDelegate.authConfig(DockerClientDelegate.java:107)
        at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:316)
        at org.testcontainers.junit.jupiter.TestcontainersExtension$StoreAdapter.start(TestcontainersExtension.java:242)
        at org.testcontainers.junit.jupiter.TestcontainersExtension$StoreAdapter.access0(TestcontainersExtension.java:229)
        at org.testcontainers.junit.jupiter.TestcontainersExtension.lambda$null(TestcontainersExtension.java:59)
        at org.junit.jupiter.engine.execution.ExtensionValuesStore.lambda$getOrComputeIfAbsent[=11=](ExtensionValuesStore.java:81)
        at org.junit.jupiter.engine.execution.ExtensionValuesStore$MemoizingSupplier.get(ExtensionValuesStore.java:182)
        at org.junit.jupiter.engine.execution.ExtensionValuesStore.getOrComputeIfAbsent(ExtensionValuesStore.java:84)
        at org.junit.jupiter.engine.execution.NamespaceAwareStore.getOrComputeIfAbsent(NamespaceAwareStore.java:53)
        at org.testcontainers.junit.jupiter.TestcontainersExtension.lambda$beforeAll(TestcontainersExtension.java:59)
        at java.util.ArrayList.forEach(ArrayList.java:1259)
        at org.testcontainers.junit.jupiter.TestcontainersExtension.beforeAll(TestcontainersExtension.java:59)
        at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeBeforeAllCallbacks(ClassBasedTestDescriptor.java:359)
        at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
        at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeBeforeAllCallbacks(ClassBasedTestDescriptor.java:359)
        at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.before(ClassBasedTestDescriptor.java:189)
        at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.before(ClassBasedTestDescriptor.java:78)
        at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively(NodeTestTask.java:132)
        at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
        at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively(NodeTestTask.java:125)
        at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)
        at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively(NodeTestTask.java:123)
        at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
        at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)
        at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)
        at java.util.ArrayList.forEach(ArrayList.java:1259)
        at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
        
       

感谢任何帮助 谢谢

偶然发现了这里:当我不是 运行 docker 引擎和服务时,我遇到了同样的问题。 您 docker 安装了吗?运行 是否安装了服务?