-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for https://docs.docker.com/compose/extends/ #214
Conversation
This is a great idea - nice! I'll review tonight. |
addEnv("COMPOSE_FILE", pwd + "/" + composeFile.getAbsoluteFile().getName()); | ||
File dockerComposeMainFile = composeFiles.get(0); | ||
final String pwd = dockerComposeMainFile.getAbsoluteFile().getParentFile().getAbsolutePath(); | ||
List<String> absoluteDockerComposeFiles = composeFiles.stream().map(file -> pwd + "/" + file.getAbsoluteFile().getName()).collect(Collectors.toList()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please could you use File.separator rather than "/", just in case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The benefit of "/" is that it works both on windows and unix like systems. This why used it instead of File.separator
Please could we also have some tests to ensure this is working? |
Sure I will add some tests and will trigger again. |
@sourcecase did you have a chance to create some tests for this yet? |
Hi Richard, |
I created a new pull request for the same feature from a different branch including tests: #227 |
It is possible to pass more then one docker-compose file to the docker-compose comand as decribed here https://docs.docker.com/compose/extends/
To make this feature available in testcontainers a list of docker-compose files ahs to be passed to DockerComposeContainer.
The files have to be concatenated in the COMPOSE_FILE env variable as described here https://docs.docker.com/compose/reference/envvars/