testContainers and Rancher
Asked Answered
T

5

6

I have a Spring Boot application with integration tests that are using testContainers.

Till recently, I used Docker Desktop and was able to easily run the test from within Intellij or from CLI.

Recently I changed my Windows machine to Rancher desktop.

Now when trying to run the integration tests gradle integrationTest I'm getting this error:

Caused by: java.lang.IllegalStateException: Previous attempts to find a Docker environment failed. Will not retry. Please see logs and check configuration at org.testcontainers.dockerclient.DockerClientProviderStrategy.getFirstValidStrategy(DockerClientProviderStrategy.java:109) at org.testcontainers.DockerClientFactory.getOrInitializeStrategy(DockerClientFactory.java:136) at org.testcontainers.DockerClientFactory.client(DockerClientFactory.java:178) at org.testcontainers.LazyDockerClient.getDockerClient(LazyDockerClient.java:14) at org.testcontainers.LazyDockerClient.authConfig(LazyDockerClient.java:12) at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:310)

Is there an additional configuration that is needed in Intellij or Rancher or Windows to make it work?

Terylene answered 20/1, 2022 at 12:28 Comment(0)
G
4

UPDATE Feb 2022: As reported here TestContainers works nicely with Rancher Desktop 1.0.1.

Based on the following two closed issues - first, second - in the testcontainers-java github, Testcontainers doesn't seem to support Rancher Desktop, at least officially.

Gripping answered 26/1, 2022 at 14:56 Comment(0)
E
6

In my case, you needed to set it to allow sudo access. You can set it as such

enter image description here

Egocentric answered 12/7, 2023 at 15:5 Comment(1)
This is the answer that worked for me too. It is absolutely unnecessary that sudo access is required to be able to boot up containers from testcontainers.Seeker
G
4

UPDATE Feb 2022: As reported here TestContainers works nicely with Rancher Desktop 1.0.1.

Based on the following two closed issues - first, second - in the testcontainers-java github, Testcontainers doesn't seem to support Rancher Desktop, at least officially.

Gripping answered 26/1, 2022 at 14:56 Comment(0)
A
1

I got this error because my Rancher was using containerd. If you also use Rancher Desktop try to switch to dockerd under settings, but first back up the data you have just in case.

Ablepsia answered 17/1, 2023 at 13:29 Comment(0)
G
0

I'm running rancher desktop version 1.0.0 on my windows mashine and could get testcontainers to work just by simple adding 'checks.disable=true' in .testcontainers.properties (located under C:\Users<your user>)

Gernhard answered 27/1, 2022 at 15:4 Comment(1)
thanks for the post, but this didn't work for me.Terylene
R
0

updating Rancher Desktop to version 1.0.1 fixed this issue for me

Recitativo answered 3/2, 2022 at 12:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.