2

I want to make my testcontainers in Java integration tests work with minikube replacing Docker Desktop.

I followed below article to get started: https://www.atomicjar.com/2021/10/docker-on-windows-and-macos/#minikube

This is what I've got in testcontainers.properties

docker.client.strategy=org.testcontainers.dockerclient.EnvironmentAndSystemPropertyClientProviderStrategy
docker.host=tcp\://192.168.64.2\:2376
docker.cert.path=/Users/username/.minikube/certs
docker.tls.verify=true

Although my docker is up and running, I'm getting following exception:

Caused by: java.lang.IllegalStateException: Could not find a valid Docker environment. Please see logs and check configuration

Can anybody please suggest anything to make it working?

TA

tyro
  • 577
  • 8
  • 17

2 Answers2

0

If you are using gradle try -no-daemon flag to use a new daemon. Your old gradle daemon still using your previous testcontainers properties, also restart your IDE if you're running your build inside.

Muhammad Dyas Yaskur
  • 6,914
  • 10
  • 48
  • 73
Gad Ry
  • 11
  • 2
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Dec 22 '21 at 15:31
0

After restarting Minikube and Intellij editor, and updating testcontainer-bom to be the latest - from 1.15 to 1.16.2, I was able to pull some third-party docker images. This means docker is working now.

However, I'm still trying to find a way to work with local images (Other application docker images) for integration testing as it used to work with Docker Desktop.

tyro
  • 577
  • 8
  • 17