我正在将Linux容器部署到用于容器的Azure Web应用程序中,并在执行此操作时获取错误:
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)
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中做到这一点。任何帮助都将不胜感激。