Can I use a Windows .Net app with Docker?

后端 未结 6 1169
小鲜肉
小鲜肉 2021-01-01 11:43

I\'m a little confused by all the chat about Docker, and how it fits into the virtualisation world. So here\'s a straight question: can I package up a .Net application (that

6条回答
  •  情歌与酒
    2021-01-01 12:09

    below is example dockerfile to run .net 4.5 app

    FROM microsoft/iis
    
    RUN ["powershell.exe", "Install-WindowsFeature NET-Framework-45-ASPNET"]
    RUN ["powershell.exe", "Install-WindowsFeature Web-Asp-Net45"]
    
    ADD publisedDir/ c:\\website
    
    EXPOSE 8081
    
    RUN powershell New-Website -Name 'websiteName' -Port 8081 -PhysicalPath 'c:\website' -ApplicationPool '.NET v4.5'
    
    ENTRYPOINT powershell
    

提交回复
热议问题