简体   繁体   English

如何将ASP.NET应用程序部署到Linux服务器上的Docker容器?

[英]How to deploy asp.net application to docker container on Linux server?

I have installed docker engine on a Linux server. 我已经在Linux服务器上安装了docker引擎。 On my desktop's Visual Studio 2015, I created an asp.net application. 在桌面的Visual Studio 2015上,我创建了一个asp.net应用程序。 Now I want to publish it to the Linux server and create a docker image. 现在,我想将其发布到Linux服务器并创建一个docker映像。

I followed this step . 我遵循了这一步骤

2

I don't have an azure account and I want to use my own Linux server. 我没有azure帐户,我想使用自己的Linux服务器。 So next, I clicked the Docker Containers . 因此,接下来,我单击了Docker Containers The interface became: 界面变为:

3

Then I clicked Custom Docker Host and pressed OK button. 然后,单击“ Custom Docker Host然后按“确定”按钮。

The interface was 该接口是

4

Now I input the image name as DockerDemo . 现在,我将映像名称输入为DockerDemo Also I type the server url something like tcp://12.16.45.56:8080 . 我还要输入服务器网址,例如tcp://12.16.45.56:8080 Validate connection is okay then go to the next step. 验证连接正常,然后转到下一步。

Finally I get this: 终于我明白了:

五

However I get an error during publish. 但是在发布过程中出现错误。

Severity Code Description Project File Line Suppression State Error An error occured during publish. 严重性代码说明项目文件行抑制状态错误发布期间发生错误。 The command [docker -H tcp://12.16.45.56:8080 build -t DockerDemo -f "C:\\Users\\me\\AppData\\Local\\Temp\\PublishTemp\\DockerDemo63\\approot\\src\\DockerDemo\\Dockerfile" "C:\\Users\\me\\AppData\\Local\\Temp\\PublishTemp\\DockerDemo63"] exited with code 1 : 'docker' is not recognized as an internal or external command, operable program or batch file. 命令[docker -H tcp://12.16.45.56:8080 build -t DockerDemo -f“ C:\\ Users \\ me \\ AppData \\ Local \\ Temp \\ PublishTemp \\ DockerDemo63 \\ approot \\ src \\ DockerDemo \\ Dockerfile”“ C: \\ Users \\ me \\ AppData \\ Local \\ Temp \\ PublishTemp \\ DockerDemo63“]以代码1退出:'docker'不被识别为内部或外部命令,可操作程序或批处理文件。 Please visit http://go.microsoft.com/fwlink/?LinkID=529706 for troubleshooting guide. 请访问http://go.microsoft.com/fwlink/?LinkID=529706,以获取故障排除指南。 DockerDemo 0 DockerDemo 0

By the way, the framework I am using is: 顺便说一句,我正在使用的框架是:

  "frameworks": {
  "dnx451": { },
  "dnxcore50": { }
}

Thanks for help! 感谢帮助!

Visual Studio can't find the docker command on your local computer. Visual Studio在本地计算机上找不到docker命令。 It needs this as a client to connect to the docker daemon on your Linux server. 它需要它作为客户端连接到Linux服务器上的docker守护程序。 The easiest way to do this is to install Docker Toolbox from here: 最简单的方法是从此处安装Docker Toolbox:

https://www.docker.com/products/docker-toolbox https://www.docker.com/products/docker-toolbox

You may have to uninstall and re-install "Visual Studio 2015 Tools for Docker" or manually add to Powershell's $env:Path if the docker command still can't be found. 如果仍然找不到docker命令,则可能必须卸载并重新安装“适用于Docker的Visual Studio 2015工具”,或者手动将其添加到Powershell的$env:Path

Also, your Image Name must not contain uppercase characters. 另外,您的图片名称不得包含大写字符。 Use dockerdemo rather than DockerDemo . 使用dockerdemo而不是DockerDemo

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 ZEDC9F0A5A5D57797BF68E373674 服务器中部署 ASP.NET Web 应用程序到 Docker - How to Deploy ASP.NET Web App To Docker In Linux Server 将ASP.Net应用程序部署到Window Server Core容器 - Deploy ASP.Net Application to Window Server Core Container 如何使用Docker容器设置ASP.NET Web应用程序 - How to setup ASP.NET Web Application with Docker container 如何将ASP.NET网站(ASP.NET 5之前的版本)部署到Linux服务器? - How to deploy ASP.NET website (version prior to ASP.NET 5) to Linux server? 如何将asp.net应用程序部署到我的服务器 - How to deploy an asp.net application to my server 如何在本地服务器上托管和部署ASP.NET Web应用程序 - How to host and deploy an ASP.NET web application on a local server 如何在 Linux 服务器上提供 ASP.NET 应用程序? - How can I serve an ASP.NET application on a Linux Server? 无法访问Windows Server 2016 Azure VM的Docker容器中托管的Asp.Net vNext应用程序 - Unable to access Asp.Net vNext application hosted in Docker Container in Windows Server 2016 Azure VM 是否可以将ASP.NET应用程序部署为桌面应用程序(带有服务器组件) - Is it possible to deploy an ASP.NET application as desktop application (with server component) 如何使用SQL Server和Asp.net在专用服务器中部署Web应用程序? - How can I deploy my web application In dedicated server using SQL Server and Asp.net?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM