1

I wonder if there is a way to bootstrap a Docker environment when running tests with @Testcontainers.

Right now when I run a test:

@Testcontainers @SpringBootTest internal class MyTest() { @Container val mongoDBContainer = MongoDBContainer("mongo:latest") 

and I don't have Docker Desktop enabled I get:

java.lang.IllegalStateException: Could not find a valid Docker environment. Please see logs and check configuration 
3
  • Also see Test Container test cases are failing due to "Could not find a valid Docker environment". You need additional permissions to install Docker in almost every environment, which your normal unit-test setup probably won't have. I might separate out true unit tests from integration tests that have complex external dependencies like Docker. Commented Jun 11, 2024 at 15:18
  • @DavidMaze I don't want to install it, just start Commented Jun 11, 2024 at 19:08
  • Testcontainers requires a container runtimes, such as Docker. Commented Jun 14, 2024 at 8:05

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.