testcontainers-java icon indicating copy to clipboard operation
testcontainers-java copied to clipboard

docker-compose files from two different locations

Open HaMatthias opened this issue 7 years ago • 3 comments

Why is it not possible to supply two docker-compose.yml-files from different directories to the DockerComposeContainer-Constructor?

e.g. like:

new DockerComposeContainer(new File("first/directory/docker-compose.yml"), new File("first/docker-compose.override.yml"))

There is always occuring the a FileNotFoundError in the containerized docker environment.

HaMatthias avatar Sep 11 '19 07:09 HaMatthias

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe this is a mistake, please reply to this comment to keep it open. If there isn't one already, a PR to fix or at least reproduce the problem in a test case will always help us get back on track to tackle this.

stale[bot] avatar Dec 10 '19 08:12 stale[bot]

Hmm, this shouldn’t go stale, as we can probably resolve this.

The problem will be occurring because we need to provide one root directory to Docker-compose, via which all compose files should be resolvable. I can’t recall the mechanism we’re using, but the complexity when there are multiple files happens because that root directory could come from the current working directory, any of the compose files’ parent dirs, a common ancestor, etc... The problem is compounded if compose files are specified absolutely or only have / as a common ancestor.

I’m sure we could improve this further, though - would be open to suggestions.

Sent with GitHawk

rnorth avatar Dec 14 '19 17:12 rnorth

Hi, I'd like to work on this issue!

snehal242005 avatar Jul 11 '26 07:07 snehal242005