如何将.NET 4.0写的Windows service和Web API部署到docker上面
2018-02-27 15:11
597 查看
Web API.
看这篇文章:
https://docs.microsoft.com/en-us/aspnet/mvc/overview/deployment/docker-aspnetmvc
Windows service.
看这篇文章https://stackoverflow.com/questions/39705529/console-app-or-windows-service-in-windows-container
一个docker container就是一个service,可以把windows service改写成exe, 然后在docker container里面一直运行这个exe, container启动了就等于service启动了,container停止了就等于service停止了。
继续看第三点如何将Exe部署到docker上面去。
Windows application.
看这篇文章: https://hub.docker.com/r/microsoft/dotnet-framework/
这里是如何在docker上部署一个.net的console application: https://docs.microsoft.com/en-us/dotnet/framework/docker/console
看这篇文章:
https://docs.microsoft.com/en-us/aspnet/mvc/overview/deployment/docker-aspnetmvc
Windows service.
看这篇文章https://stackoverflow.com/questions/39705529/console-app-or-windows-service-in-windows-container
一个docker container就是一个service,可以把windows service改写成exe, 然后在docker container里面一直运行这个exe, container启动了就等于service启动了,container停止了就等于service停止了。
No, you don't want to install it as a service. When you run an application in a container, Docker monitors the active process in the container. If the active process stops, the container exits. So you should run your app in the foreground, and let Docker put the container in the background (by starting it with docker run -d). An exception is where the existing platform is already a Windows Service - e.g. the microsoft/iisimage. IIS is running in the background in the container, so you need to start another process to keep the container running - which is why you see IIS containers started like this: docker run -d -p 80:80 microsoft/iis ping -t localhost The ping command keeps the container running, while the IIS service actually responds to requests. This is not ideal though, Docker is monitoring ping so if the IIS service stops the container keeps running. |
Windows application.
看这篇文章: https://hub.docker.com/r/microsoft/dotnet-framework/
这里是如何在docker上部署一个.net的console application: https://docs.microsoft.com/en-us/dotnet/framework/docker/console
相关文章推荐
- 如何在windows 2003(虚拟主机)上面部署MVC3
- 如何把spring微服务部署为Windows Service并开机自动启动
- Docker: 如何将node.js的项目部署到docker的swarm上面去
- .NET : 如何在Windows Service中获取到当前工作目录
- 如何让带证书的WCF服务 部署在以network service 帐户运行的Windows Service中 原创
- .NET : 如何在Windows Service中获取到当前工作目录
- .net下 Windows Service 部署
- .net下 Windows Service 部署
- WindowsService部署和问题的解决方法
- win2003 sp2+iis 6.0上部署.net 2.0和.net 4.0网站的方法
- 如何使用Windows Azure Media Service进行开发(2)
- 如何托管ASP.NET Core应用到Windows Service中
- 如何修复:Windows上面的WScript的脚本(.vbs)不能执行了?
- 详解基于docker 如何部署surging分布式微服务引擎
- .net 4.0部署网站出现: “找不到请求的 .Net Framework Data Provider。可能没有安装。"
- Web项目身份验证设置为Windows时如何将项目部署到IIS进行调试
- 如何将VS2010的.net项目部署到iis7.5
- 如何使用windows版Docker并在IntelliJ IDEA使用Docker运行Spring Cloud项目
- 如何在Windows系统上面安装redis
- SharePoint【调试,诊错系列】-- 如何在Windows 2008中部署dll到GAC