Dockertools: Please allow extra command line parameters to be passed to docker-compose

Created on 27 Jan 2018  路  13Comments  路  Source: microsoft/DockerTools

It would be great to allow extra command line parameters

Most helpful comment

There is still no good solution in 2020.

All 13 comments

There is one work around you can do right now.
Open the generated obj\Docker\docker-compose.vs.debug.g.yml, if you want to override anything in here, create docker-compose.vs.debug.yml alongside with docker-compose.yml, override anything you want there, in your case, you will want to override the com.microsoft.visualstudio.debuggee.arguments.

For example, if I want to add a parameter to my dotnet core console application, I'll do the following:

version: '3.4'

services:
  foo:
    labels:
        com.microsoft.visualstudio.debuggee.arguments: " --additionalProbingPath c:\\.nuget\\packages --additionalProbingPath c:\\.nuget\\fallbackpackages  bin\\Debug\\netcoreapp2.0\\ConsoleApp4.dll bar"

Hi @yanchenw, I am using VS2017 15.5.7.
When I add docker support to a .NET web application, the files docker-compose.vs.debug.g.yml and docker-compose.vs.release.g.yml are not created in the docker-compose project.
When the solution is built, the same files are not created in the -obj/Docker folder either.
Even, when I manually add them, they are ignored.

Is this a bug? How can we have control over different compositions for debug/release mode?

Thanks,

@Ben-m-s if your debugging is working, the files should be generated under the obj folder in the same directory where the docker-compose.dcproj is. Can you double check?

Thanks for your quick response.

I was checking the "obj" folder under the website folder. I didn't realise that there was an "obj" folder at solution level.

I also found that a manually created file named "docker-compose.vs.debug.yml" saved with the project "docker-complose.dcproj" (at solution level) is detected by VS and used while building the solution with the Debug configuration.

I had done several previous unsuccessful attempts, with different file names such as "docker-compose.vs.debug.g.yml", until I finally found the right name.

Regards,

Ben

@Ben-m-s I'm glad it works for you. Closing.

@yanchenw the original issue hasn't been addressed.

I would also like to specify additional docker-compose parameters. At a bare minimum it should be possible to specify a number of override files using -f docker-compose.override1.yml -f docker-compose.override2.yml etc...

I got hit by this too. I've added a docker-compose.vs.debug.yml file for now and it works but it would be great to have a less magical solution.

@Ben-m-s I'm glad it works for you. Closing.

The workaround is unintuitive and it would be great to address this. Alternately, if there are no plans to support this then please consider disabling the "Application arguments" textbox in the project properties Debug pane.

I'll add my name to the list of calling to support this in project Debug properties. We are starting to dockerize many command line apps now, and this limitation is just another thing to remember.

The whole docker support in Visual Studio is in very early stages. So many things are not working.
This is really a bad thing. Its just not working as expected and as for every handicap in the VS docker support, the workaround is so unintuitive.

+1 - unfortunately, original issue was not addressed. I have a feeling that workaround proposed is just too obscure for a regular users.

@rolnikrolnik , @bormm, if using the latest VS 2019, we have added documentation for both the single container tooling and Docker Compose projects that explains the customization points through MSBuild properties added to the project. Please see [https://docs.microsoft.com/en-us/visualstudio/containers/docker-compose-properties?view=vs-2019] for compose specifically. If still experiencing issues after following any of this, please open a new issue and we will look into.

There is still no good solution in 2020.

Was this page helpful?
0 / 5 - 0 ratings