I have used the Visual Studio templates to add Docker support and the user secrets has the password for the certificate and the user secrets and certificate are mounted as volumes in docker-compose.override.yml:
volumes: - ${APPDATA}/ASP.NET/Https:C:\Users\ContainerUser\AppData\Roaming\ASP.NET\Https:ro - ${APPDATA}/Microsoft/UserSecrets:C:\Users\ContainerUser\AppData\Roaming\Microsoft\UserSecrets:ro I even connected to the container to verify the certicate was in the Https folder. It is not being installed for some reason. Running the app throws an error that the dev certificate doesn't exist in the certificate store. How am I supposed to install it? Is there a setting that I need so that it installs automatically in the container?
Exact error message:
System.InvalidOperationException: 'Unable to configure HTTPS endpoint. No server certificate was specified, and the default developer certificate could not be found.
I could follow the error instructions to create the cert and add it in the container myself with:
dotnet dev-certs https dotnet dev-certs https --trust However the .net sdk is not installed in the final container, just the .net core runtime.
