docker run command for ASP.NET Core and Visual Studio 2017

Viewed 4291

I'm developing an ASP.NET Core application with Visual Studio 2017. I've set up debugging to run the server in a docker container. The container is up and running, but I can't access the database, which is hosted in another docker container.

The database container exposes a port on the host. I need to tell the ASP.NET Core container to map the host's port to an internal port. For this I need to change the docker run command Visual Studio issues to run the container.

Where can I find it so I can change it?

2 Answers

You can add the <DockerfileRunArguments> tag to the <PropertyGroup> section in your *.csproj file and put additional run parameters there.

e.g.

<Project Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    <DockerfileRunArguments>-p 5000:6000</DockerfileRunArguments>
  </PropertyGroup>
</Project>

You cannot change the command , however you may create a new Debug Profile and make modifications to the Application Arguments...something like this enter image description here

Related