【问题标题】:Error while publising to docker on Azure from Visual Studio 2015从 Visual Studio 2015 发布到 Azure 上的 docker 时出错
【发布时间】:2016-03-30 12:16:55
【问题描述】:

我正在尝试使用 this Visual Studio 扩展通过 Visual Studio 2015 在 Azure Docker 上发布我的 ASP.NET Core 网站。我尝试了不同的方法,但未能在每种方法中部署。

方法 1 直接从 Visual Studio 创建了一个 Windows docker 容器。在这种情况下,VM 已成功创建,并且我能够在发布之前成功验证连接。

但是,发布失败并出现以下错误

Step 1 : FROM microsoft/aspnet:1.0.0-rc1-update1 Pulling repository
docker.io/microsoft/aspnet Error: image
microsoft/aspnet:1.0.0-rc1-update1 not found

方法 2 直接从 Visual Studio 创建了一个 Linux docker 容器。同样,VM 已成功创建,并且我能够在发布之前成功验证连接。发布时出现以下错误:

Executing command [docker --tlsverify -H tcp://vmname.southeastasia.cloudapp.azure.com:2376 logs cf32793c88939d664f67c651cbc75c4fb348fdd6fe85ea67322f9b5d049c0e70]
Failed to connect to http://vmname.southeastasia.cloudapp.azure.com/. If your Docker host is an Azure virtual machine, please make sure to set up the endpoint '80' using the Azure portal.
Container logs:
System.InvalidOperationException: The current runtime target framework is not compatible with 'MulitvideoMonitoring'.

Current runtime target framework: 'DNX,Version=v4.5.1 (dnx451)'

 Version:      1.0.0-rc1-16231
 Type:         Mono
 Architecture: x64
 OS Name:      Linux
 OS Version:   debian 7
 Runtime Id:   ubuntu.14.04-x64


Please make sure the runtime matches a framework specified in project.json
  at Microsoft.Dnx.ApplicationHost.DefaultHost.GetEntryPoint (System.String applicationName) [0x00000] in <filename unknown>:0 
  at Microsoft.Dnx.ApplicationHost.Program.ExecuteMain (Microsoft.Dnx.ApplicationHost.DefaultHost host, System.String applicationName, System.String[] args) [0x00000] in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
  at Microsoft.Dnx.Runtime.Common.EntryPointExecutor.Execute (System.Reflection.Assembly assembly, System.String[] args, IServiceProvider serviceProvider) [0x00000] in <filename unknown>:0 
  at Microsoft.Dnx.Host.Bootstrapper.RunAsync (System.Collections.Generic.List`1 args, IRuntimeEnvironment env, System.String appBase, System.Runtime.Versioning.FrameworkName targetFramework) [0x00000] in <filename unknown>:0 

方法 3 从 Azure 门户创建经典 VM,并打开端口 80。在验证连接时它失败了。发布时无法连接到虚拟机并出现以下错误:

Executing command [docker --tlsverify -H tcp://vmname.cloudapp.net:2376 ps -a | select-string -pattern ":80->" | foreach { Write-Output $_.ToString().split()[0] }]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.DNX.Publishing.targets(386,5): 
Error : An error occurred trying to connect: Get https://vmname.cloudapp.net:2376/v1.22/containers/json?all=1: dial tcp 23.97.54.64:2376: 
connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

请求您帮助找出上述三种方法中的问题。

【问题讨论】:

  • 几个问题:Docker 守护进程是否在监听 tcp 端点?如果您 ssh 进入 docker 主机并执行“docker -H tcp://vmname.southeastasia.cloudapp.azure.com:2376 ps”,它会起作用吗? docker 守护进程正在侦听的 tcp 端口是否可以从外部访问?

标签: c# asp.net docker visual-studio-2015 asp.net-core


【解决方案1】:

我能够解决我的 Linux VM 上的问题。问题是由于 dockerfile 中的错误运行时所致。从 Visual Studio 工具自动生成的 dockerfile 的运行时错误导致了问题。 dockerfile 的运行时 FROM microsoft/aspnet:1.0.0-rc1-update1 将其更改为 microsoft/aspnet:1.0.0-rc1-update1-coreclr 解决了这个问题。我从here 提出的类似问题的答案中得到了提示。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多