Open DaleyKD opened 4 years ago
Any update on this?
Hi @DaleyKD,
The file docker-compose.vs.debug.g.yml
gets generated each time you debug.
That means, even though the name of the file would be same for different dcproj, it would be overwritten each time you debug any project.
Please let us know if this behavior is breaking any of your scenarios?
@pratiksanglikar : I understand. I meant, instead of you using a file named docker-compose.vs.debug.g.yml
, could you not use a static named file and make it based upon the DockerComposeBaseFilePath
?
var partialYmlFileName = $"{DockerComposeBaseFilePath}.vs.debug.g.yml";
Hi @DaleyKD,
The DockerComposeBaseFilePath
can contain characters that indicate relative paths. i.e. ..\
etc.
So, using this variable as a prefix for generated files may not be the optimal option.
However, I would like to understand your use case and can probably give you a workaround on what you are trying to achieve.
Hi, I have a Test configuration which the value of DockerComposeBaseFilePath
is docker-compose-tests
. I want to override the entrypoint
for this configuration as such:
entrypoint: dotnet test --logger "trx;LogFileName=/tests/test-results.xml"
I don't want it to be applied to other configurations (e.g. Debug, Release). I know we can override the docker-compose.vs.*.g.yml
by placing a file named docker-compose.vs.*.yml
in the same directory as the docker-compose.yml
file. Is it possible to make the naming convention of the filename of docker-compose.vs.*.yml
to follow the value of DockerComposeBaseFilePath
so for my use case, it would be docker-compose-tests.vs.*.yml
?
@yunyanng as of now DockerComposeBaseFilePath does not support that. The closest you could get to this behavior would be to create a separate .dcproj in Its own folder that uses DockerComposeBaseFilePath to re-use the compose files from the original project. The new project could then have its own docker-compose.vs.*.yml files that would not impact the original project.
@NCarlsonMSFT I would stick to the solution you suggested until the behavior is supported. Thanks!
I'm trying to use numerous .sln files in the same root directory of a massive project. Trying to break it into smaller chunks, I have the need for different docker-compose files.
In my .dcproj file, I have set:
The
DockerComposeBaseFilePath
does a good job of affecting thedocker-compose
cmd that runs for the first two -f args, but it shares the samedocker-compose.vs.debug.partial.g.yml
file as the other .dcprojs.It generates:
docker-compose -f "C:\src\k\docker-compose-corewebs.yml" -f "C:\src\k\docker-compose-corewebs.override.yml" -f "C:\src\k\obj\Docker\docker-compose.vs.debug.g.yml" -p dockercomposecorewebs15517584978595564736 --no-ansi config
I would expect it to generate:
docker-compose -f "C:\src\k\docker-compose-corewebs.yml" -f "C:\src\k\docker-compose-corewebs.override.yml" -f "C:\src\k\obj\Docker\docker-compose**-corewebs**.vs.debug.g.yml" -p dockercomposecorewebs15517584978595564736 --no-ansi config
(sans asterisks)