So recently docker-integration in VS2017 has removed the docker project and simply works from launchsettings.json
and a Dockerfile
.
In my launchsettings.json
I have the following:
"Docker": {
"commandName": "Docker",
"launchBrowser": true,
"launchUrl": "{Scheme}://localhost:{ServicePort}/swagger"
}
Whenever I debug the application a random port is assigned.
If I include a valid sslPort in the iisExpress
settings it takes the correct http and https ports from there, however my application is not currently using https so I'd rather not bind an unused port.
The below iisExpress settings seem to influence the docker settings. While below gives me what I want (a consistent binding from 81:80, host:container) I would prefer that port 444 was not also bound, or that the settings within another profile influence a different profile.
"iisExpress": {
"applicationUrl": "http://localhost:81/",
"sslPort": 444 (takes a random port if set to 0)
}
Any ideas? I would just like to be able to set the ServicePort
/ default port to a known value.
In launchSettings. json, the settings in the Docker section are related to how Visual Studio handles containerized apps. These command-line arguments for starting your app are used when launching your project in the container. Additional arguments to pass to the docker run command.
You can directly edit the launchSettings. json file in Visual Studio for Mac, or you can use project options to edit it. To get to the project options, right-click your project and select Options. Select Run > Configurations > Default.
This settings will be useful if shared among project members, so it should be commited to the repo.
The Docker section in launchsettings.json supports now httpPort
and sslPort
settings:
"Docker": {
...
"httpPort": 8080
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With