I am trying to create test container with DockerComposeContainer.
DockerComposeContainer container =
new DockerComposeContainer(
new File("src/integrationTest/resources/mycompose-file.yml"))
.withLocalCompose(true)
.withExposedService("mongodb", 27017, Wait.forListeningPort());
container.start();
return container;
mycopose-file.yml has following:
version: '3'
services:
mongodb:
image: mongo:3.6
environment:
MONGO_INITDB_ROOT_USERNAME: uname
MONGO_INITDB_ROOT_PASSWORD: upass
My test dependency include: testcontainers-1.12.3.jar
I am getting error during application context startup:
java.lang.IllegalStateException: Failed to load ApplicationContext
with root cause:
Caused by: org.testcontainers.containers.ContainerLaunchException: Local Docker Compose exited abnormally with code 1 whilst running command: up -d
at org.testcontainers.containers.LocalDockerCompose.invoke(DockerComposeContainer.java:711)
....