我正在尝试使用此命令为.NET Core 2.2 Web应用程序构建docker映像
docker-compose -f docker-compose.override.yml -f docker-compose.yml up --build
但是我遇到以下错误:
Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager [0] 演示|用户个人资料可用。使用“ /root/.aspnet/DataProtection-Keys”作为密钥存储库;密钥在静止时不会被加密。 演示|暴击:Microsoft.AspNetCore.Server.Kestrel [0] 演示|无法启动红est。 演示| System.InvalidOperationException:无法配置HTTPS端点。未指定服务器证书,并且找不到默认的开发人员证书。 演示|要生成开发者证书,请运行“ dotnet dev-certs https”。要信任证书(仅限Windows和macOS),请运行'dotnet dev-certs https --trust'。 演示|有关配置HTTPS的更多信息,请参见https://go.microsoft.com/fwlink/?linkid=848054。 演示|在Microsoft.AspNetCore.Hosting.ListenOptionsHttpsExtensions.UseHttps(ListenOptions listenOptions,操作
1 configureOptions) demo | at Microsoft.AspNetCore.Hosting.ListenOptionsHttpsExtensions.UseHttps(ListenOptions listenOptions) demo | at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.AddressesStrategy.BindAsync(AddressBindContext context) demo | at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.BindAsync(IServerAddressesFeature addresses, KestrelServerOptions serverOptions, ILogger logger, Func
2 createBinding)处 演示|在Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer.StartAsync [TContext](IHttpApplication1 application, CancellationToken cancellationToken) demo | demo | Unhandled Exception: System.InvalidOperationException: Unable to configure HTTPS endpoint. No server certificate was specified, and the default developer certificate could not be found. demo | To generate a developer certificate run 'dotnet dev-certs https'. To trust the certificate (Windows and macOS only) run 'dotnet dev-certs https --trust'. demo | For more information on configuring HTTPS see https://go.microsoft.com/fwlink/?linkid=848054. demo | at Microsoft.AspNetCore.Hosting.ListenOptionsHttpsExtensions.UseHttps(ListenOptions listenOptions, Action
1 configureOptions)处 演示|在Microsoft.AspNetCore.Hosting.ListenOptionsHttpsExtensions.UseHttps(ListenOptions listenOptions) 演示|在Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.AddressesStrategy.BindAsync(AddressBindContext上下文) 演示|在Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.BindAsync(IServerAddressesFeature地址,KestrelServerOptions服务器选项,ILogger记录器,Func2 createBinding) demo | at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer.StartAsync[TContext](IHttpApplication
1应用程序,CancellationToken cancelledToken)处 演示|在Microsoft.AspNetCore.Hosting.Internal.WebHost.StartAsync(CancellationToken cancelledToken) 演示|在Microsoft.AspNetCore.Hosting.WebHostExtensions.RunAsync(IWebHost主机,CancellationToken令牌,字符串shutdownMessage) 演示|在Microsoft.AspNetCore.Hosting.WebHostExtensions.RunAsync(IWebHost主机,CancellationToken令牌) 演示|在Microsoft.AspNetCore.Hosting.WebHostExtensions.Run(IWebHost主机)上
我通过以下步骤在Google上进行了一些研发,以解决上述问题:但是没有运气。
dotnet开发人员证书https --check --verbose
找到了有效的证书。
dotnet开发人员证书https
有效的HTTPS证书已经存在。
dotnet开发人员证书https --trust
请求信任HTTPS开发证书。如果 证书尚未受信任,我们将运行以下命令: 'sudo安全性add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain <>'此命令可能 提示您输入密码以在系统上安装证书 钥匙扣。有效的HTTPS证书已经存在。
注意:我已经从 certmgr 中删除了当前证书。然后运行相同的上述命令,但没有用。
所以,谁能告诉我如何解决此问题。