簡體   English   中英

TestContainer 找不到 docker 守護進程 lima

[英]TestContainer cannot find the docker daemon lima

我正在運行一個 lima 默認容器,如下所示

limactl start default.yml

如果我運行docker run hello-world ,它會正常工作。 我看到這個守護進程連接的 docker 主機是unix\:///Users/user/.lima/docker/sock/docker.sock

所以我配置了 Testcontainer 屬性文件如下

docker.client.strategy=org.testcontainers.dockerclient.EnvironmentAndSystemPropertyClientProviderStrategy
docker.host=unix\:///Users/user/.lima/docker/sock/docker.sock

當我運行測試容器時,它失敗並顯示以下狀態

04:12:12.095 [testcontainers-ryuk] DEBUG org.testcontainers.utility.ResourceReaper - Sending 'label=org.testcontainers%3Dtrue&label=org.testcontainers.sessionId%3Df9821c44-4de0-44d4-89e5-634d050676a1' to Ryuk
04:12:12.101 [testcontainers-ryuk] DEBUG org.testcontainers.utility.ResourceReaper - Didn't receive 'ACK' from Ryuk. Will retry to send filters.
.............
.............```

And fails. 

How to make the Testcontainer to run on new docker environment created by Lima. Am I doing the configuration correctly?

您需要覆蓋 docker 套接字才能運行您的設置:

DOCKER_HOST=unix:///Users/your-user/.lima/docker/sock/docker.sock
TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE=/var/run/docker.sock

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM