尝试将Docker Linux应用程序(HTTPS)部署到Web应用程序的App时出错 [英] Error when trying to deploy Docker Linux application (HTTPS) to Web App for Containers

查看:227
本文介绍了尝试将Docker Linux应用程序(HTTPS)部署到Web应用程序的App时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Web App for Containers部署Docker Linux应用程序。


我的docker-compose.yml看起来像:


< pre class ="prettyprint">版本:'3.4'

服务:
myservice:
image:myimagefromregistry
ports:
- " 5555"
环境:
- ASPNETCORE_URLS = https:// +:443
- ASPNETCORE_Kestrel__Certificates__Default__Path = / etc / ssl / certs / docker_certificate.pfx
- ASPNETCORE_Kestrel__Certificates__Default__Password = mypassword
卷:
- C:\ path\to\my\certs:/ etc / ssl / certs

networks:
default:
external:
名称:nat

我收到以下错误:


2019-05-22T18:33:20.506771506Z  &NBSP; &NBSP;  无法启动Kestrel。

2019-05-22T18:33:20.506777506Z Interop + Crypto + OpenSslCryptographicException:错误:2006D080:BIO例程:BIO_new_file:没有这样的文件

2019-05-22T18:33:20.520011951Z  &NBSP;在Interop.Crypto.CheckValidOpenSslHandle(SafeHandle句柄)

2019-05-22T18:33:20.520078751Z  &NBSP; at Internal.Cryptography.Pal.CertificatePal.FromFile(String fileName,SafePasswordHandle password,X509KeyStorageFlags keyStorageFlags)

2019-05-22T18:33:20.536820007Z  &NBSP;在System.Security.Cryptography.X509Certificates.X509Certificate..ctor(String fileName,String password,X509KeyStorageFlags keyStorageFlags)

2019-05-22T18:33:20.536851707Z  &NBSP;在System.Security.Cryptography.X509Certificates.X509Certificate2..ctor(String fileName,String password)

2019-05-22T18:33:20.536857407Z  &NBSP;在Microsoft.AspNetCore.Server.Kestrel.KestrelConfigurationLoader.LoadCertificate(CertificateConfig certInfo,String endpointName)

2019-05-22T18:33:20.536862107Z  &NBSP;在Microsoft.AspNetCore.Server.Kestrel.KestrelConfigurationLoader.LoadDefaultCert(ConfigurationReader configReader)

2019-05-22T18:33:20.536866907Z  &NBSP;在Microsoft.AspNetCore.Server.Kestrel.KestrelConfigurationLoader.Load()

2019-05-22T18:33:20.536871307Z  &NBSP;在Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer.ValidateOptions()

2019-05-22T18:33:20.536884408Z  &NBSP;在Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer.StartAsync [TContext](IHttpApplication`1 application,CancellationToken cancellationToken)


在本地运行此容器时我的开发环境,我的Docker Desktop让我共享本地机器的C盘。我认为这也是这种情况,我不确定如何在Azure上执行此操作。任何帮助将不胜感激。


解决方案

b


卷部分有一个"窗口"路径,这不适用于Linux。


I am trying to deploy a Docker Linux application using Web App for Containers.

My docker-compose.yml looks like:

version: '3.4'

services:
  myservice:
    image: myimagefromregistry
    ports:
      - "5555"
    environment:
      - ASPNETCORE_URLS=https://+:443
      - ASPNETCORE_Kestrel__Certificates__Default__Path=/etc/ssl/certs/docker_certificate.pfx
      - ASPNETCORE_Kestrel__Certificates__Default__Password=mypassword
    volumes:
      - C:\path\to\my\certs:/etc/ssl/certs

networks:
  default:
    external:
      name: nat

I get the following error:

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)

When running this container locally in my development environment, my Docker Desktop has me share the C drive of my local machine. I presume this is the case here as well and I'm unsure how to go about doing that on Azure. Any help would be greatly appreciated.

解决方案

Hi,

the volumes section has a "windows" path and this wouldnt work on Linux.


这篇关于尝试将Docker Linux应用程序(HTTPS)部署到Web应用程序的App时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆