I have a .NET Core Web Application project where I chose the incorrect OS under the "Enable Docker Support" checkbox:
How do I change this for an existing project? And to be clear, I want to target linux, not "Switch to Windows Containers..." in docker.
This turned out to be easy, and I did it through editing the csproj file: Changed <DockerDefaultTargetOS>Windows</DockerDefaultTargetOS>
to <DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
and reload.
I am still not sure where you would do this from Visual Studio (if it possible).
If only one project is there in the solution, I would delete the project associated with docker-compose.dcproj and Dockerfile inside the API project. After that I would right click and again add docker support to that project.
This would create new dockerfile with linux base image.
And new dcproj will have linux mentioned
<DockerTargetOS>Linux</DockerTargetOS>
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