Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The DockerfileRunArguments parameter can be applied in launchsettings.json using Visual Studio as follows:

  1. Open the launchsettings.json file in the root directory of your project.

  2. Find the configuration for your Docker container and add the DockerfileRunArguments parameter to it. For example:

{
  "name": "Docker",
  "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}",
  "environmentVariables": {
    "ASPNETCORE_ENVIRONMENT": "Development"
  },
  "dockerOptions": {
    "image": "myproject:latest",
    "dockerfile": "Dockerfile",
    "network": "host",
    "env": {
      "ASPNETCORE_ENVIRONMENT": "Development"
    },
    "DockerfileRunArguments": [
      "--foo=bar",
      "--baz=qux"
    ]
  }
}
  1. Save the launchsettings.json file.

  2. Restart your project in Visual Studio.

  3. The DockerfileRunArguments parameters will be applied to your Docker container when it is launched.