Error while publising to docker on Azure from Visual Studio 2015

I’m trying to publish my ASP.NET Core website on Azure Docker through visual studio 2015 using this Visual Studio extension. I have tried different approaches but failed to deploy in each one of them.

Approach 1
Created a windows docker container directly from Visual studio. In this case the VM was created successfully and I was to able validate the connection successfully before publish.
enter image description here

  • Assetss from wwwroot cannot be found on Docker Image
  • Cron isn't running when I start my docker container
  • Can I run existing ASP.NET MVC application in Docker without converting to ASP.NET Core in Linux
  • Docker container with ASP.NET Core libraries
  • How to remove docker support from an ASP.NET Core project?
  • .NET Core Container Built with VSTS won't run on Linux
  • However, the publish failed with following error

    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
    

    Approach 2
    Created a Linux docker container directly from Visual studio. Again, the VM was created successfully and I was able validate the connection successfully before publish. On publishing I got following error:

    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 
    

    Approach 3
    Created a classic VM from Azure portal with port 80 opened. On validating the connection it failed. While publishing it could not connect to the VM and gave following error:

    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.
    

    Request your help to figure out the issue in the above three approaches.

  • Persistence for an ASP.NET 5 Web API running in a Docker container
  • Is there any efficient way get the left physical memory in docker?
  • Does Azure Service Fabric do the same thing as Docker?
  • Unable to locate dependency 'class library project(s)'
  • Mac OS X Docker baseline aspnet error: libdl not found
  • How to deploy asp.net application to docker container on Linux server?
  • One Solution collect form web for “Error while publising to docker on Azure from Visual Studio 2015”

    I was able to resolve the issue on my Linux VM. The issue was due to the wrong runtime in dockerfile. The auto-generated dockerfile from Visual Studio tooling had wrong runtime causing the issue.
    The dockerfile had runtime FROM microsoft/aspnet:1.0.0-rc1-update1 changing it to microsoft/aspnet:1.0.0-rc1-update1-coreclr resolved the issue. I got the tip from an answer to similar question raised by me here.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.