简体   繁体   English

我们可以使用 Windows 容器将 asp.net mvc 4 应用程序部署到 docker 吗?

[英]Can we deploy an asp.net mvc 4 app to docker with windows container?

我最近看到的所有演示都是面向 Asp.net 核心的(我不确定它的稳定性和功能如何,因为它不包含所有 asp.net 功能),因为 Windows Server 2016 支持容器(和 docker),我们应该能够部署一个 asp.net mvc 4.0 应用程序吗?

Yes.是的。

You can use microsoft/windowsservercore or microsoft/iis as a base image, install full ASP.NET and run your 'legacy' .NET apps in containers on Windows.您可以使用microsoft/windowsservercoremicrosoft/iis作为基础映像,安装完整的 ASP.NET 并在 Windows 上的容器中运行“传统”.NET 应用程序。 You can do it now with Windows 10 and Server 2016 TP5, but the RTM (expected next week at Ignite) should be more stable.您现在可以使用 Windows 10 和 Server 2016 TP5 来实现,但 RTM(预计下周在 Ignite 上发布)应该更加稳定。

I've shown this by Dockerizing the old Nerd Dinner showcase app .我已经通过 Dockerizing 旧的Nerd Dinner 展示应用程序展示了这一点。 You end up with a Docker image that's 3GB so you won't get all the benefits of having a small, efficient image - but you can run your app in a container, and that's a starting point for breaking down monoliths.您最终会得到一个 3GB 的 Docker 镜像,因此您无法获得小型、高效镜像的所有好处——但您可以在容器中运行您的应用程序,这是分解单体应用的起点。

For reference, this is what the Dockerfile for a compiled ASP.NET app looks like:作为参考,编译后的 ASP.NET 应用程序的 Dockerfile 如下所示:

FROM microsoft/iis

RUN ["powershell.exe", "Install-WindowsFeature NET-Framework-45-ASPNET"]
RUN ["powershell.exe", "Install-WindowsFeature Web-Asp-Net45"]

ADD web-app/ c:\\web-app

EXPOSE 8081

RUN powershell New-Website -Name 'web-app' -Port 8081 -PhysicalPath 'c:\web-app' -ApplicationPool '.NET v4.5'

ENTRYPOINT powershell

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

相关问题 我们可以在ASP.NET MVC视图中嵌套引导容器吗? - Can we nest bootstrap container in ASP.NET MVC view? 在Docker容器ASP.NET应用程序中集成Windows身份验证 - Integrating Windows Authentication in Docker Container ASP.NET App 天蓝色Windows应用程序服务中容器中的asp.net mvc - asp.net mvc in container in an azure windows app service 我们能否将 asp.net web 应用程序部署为 AWS lambda ZC1C425268E68385D1AB5074C 为容器(4A941C) - Can we deploy asp.net web application as AWS lambda function ( as container image ) 如何将ASP.NET应用程序部署到Linux服务器上的Docker容器? - How to deploy asp.net application to docker container on Linux server? 我们可以部署在ubuntu的Windows中开发的asp.net Web应用程序吗 - can we deploy an asp.net web application developed in windows in ubuntu 如何将ASP.Net MVC 5部署到IIS 8 Windows Server 2012? - How to deploy ASP.Net MVC 5 to IIS 8 Windows Server 2012? ASP.NET MVC 部署 - ASP.NET MVC DEPLOY 如何在 ZEDC9F0A5A5D57797BF68E373674 服务器中部署 ASP.NET Web 应用程序到 Docker - How to Deploy ASP.NET Web App To Docker In Linux Server docker-compose 向上 C# ASP.NET MVC 应用程序容器沿着 ZE4728F444B24839E3F84ADF32 连接到:BA - docker-compose up C# ASP.NET MVC app container along side of a postgresql container Failed to connect to [::1]:5432
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM