当前位置: 首页 > 工具软件 > Colima > 使用案例 >

TestContainer|Docker|Colima|IntergrationTest

洪昊然
2023-12-01

Problem

Run intergration test failed, error like this below.

Could not find a valid Docker environment. Please see logs and check configuration
java.lang.IllegalStateException: Could not find a valid Docker environment. Please see logs and check configuration
	at org.testcontainers.dockerclient.DockerClientProviderStrategy.lambda$getFirstValidStrategy$4(DockerClientProviderStrategy.java)

Solution

Override the docker host detection in your zsh shell.

export TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE=/var/run/docker.sock
export DOCKER_HOST="unix://${HOME}/.colima/docker.sock"

And restart IDEA!!!

 类似资料: