【发布时间】:2019-05-22 20:15:42
【问题描述】:
我正在将 Linux 容器部署到 Azure Web Apps for Containers 并在执行此操作时遇到错误:
2019-05-22T18:33:20.506771506Z Unable to start Kestrel.
2019-05-22T18:33:20.506777506Z Interop+Crypto+OpenSslCryptographicException: error:2006D080:BIO routines:BIO_new_file:no such file
2019-05-22T18:33:20.520011951Z at Interop.Crypto.CheckValidOpenSslHandle(SafeHandle handle)
2019-05-22T18:33:20.520078751Z at Internal.Cryptography.Pal.CertificatePal.FromFile(String fileName, SafePasswordHandle password, X509KeyStorageFlags keyStorageFlags)
2019-05-22T18:33:20.536820007Z at System.Security.Cryptography.X509Certificates.X509Certificate..ctor(String fileName, String password, X509KeyStorageFlags keyStorageFlags)
2019-05-22T18:33:20.536851707Z at System.Security.Cryptography.X509Certificates.X509Certificate2..ctor(String fileName, String password)
2019-05-22T18:33:20.536857407Z at Microsoft.AspNetCore.Server.Kestrel.KestrelConfigurationLoader.LoadCertificate(CertificateConfig certInfo, String endpointName)
2019-05-22T18:33:20.536862107Z at Microsoft.AspNetCore.Server.Kestrel.KestrelConfigurationLoader.LoadDefaultCert(ConfigurationReader configReader)
2019-05-22T18:33:20.536866907Z at Microsoft.AspNetCore.Server.Kestrel.KestrelConfigurationLoader.Load()
2019-05-22T18:33:20.536871307Z at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer.ValidateOptions()
2019-05-22T18:33:20.536884408Z at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer.StartAsync[TContext](IHttpApplication`1 application, CancellationToken cancellationToken)
docker-compose.yml
version: '3.4'
services:
myservice:
image: myimage:latest-tag
ports:
- "5555"
environment:
- ASPNETCORE_URLS=https://+:443
- ASPNETCORE_Kestrel__Certificates__Default__Path=/etc/ssl/certs/certificate.pfx
- ASPNETCORE_Kestrel__Certificates__Default__Password=mypassword
volumes:
- C:\path\to\certs:/etc/ssl/certs
networks:
default:
external:
name: nat
我为容器实例创建了一个新的 Web 应用程序,使用上面的 docker-compose.yml 文件设置它并得到上面的错误。我之前在我的开发环境中尝试docker run 应用程序时看到过这个错误。这与 Docker 试图访问我计算机上的共享驱动器有关。 Docker Desktop 会提示我并询问我是否要共享该驱动器并输入登录凭据。
但是,我不知道如何在 Azure 中执行此操作。任何帮助将不胜感激。
【问题讨论】:
标签: azure docker azure-devops azure-web-app-service