Can I use a Windows .Net app with Docker?

后端 未结 6 1062
小鲜肉
小鲜肉 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 11:57

    This maybe very out of date question, but I think it need a update. Yes you can use docker with .net / .net core and will fully support in Visual Studio 2017.

    https://channel9.msdn.com/Events/Connect/2016/172

    The be no need to use WINE or Mono.

    0 讨论(0)
  • 2021-01-01 11:59

    A bit late, but still if it helps anyone. Yes we can run .Net apps on Docker as docker is now supported with Windows natively. But first you have to check your windows version, your windows build must be 14393.233 or greater. Download Docker 1.13.0 or later and then you can easily run a .Net App. This repository walks through running a sample .Net App.

    0 讨论(0)
  • 2021-01-01 12:05

    Docker builds on Linux. The only way to get the .Net app run in Docker is by using Mono for Linux.

    0 讨论(0)
  • 2021-01-01 12:08

    Not today. In future, Microsoft and Docker have announced that you there will be a Windows version of Docker.

    Edit: newer info

    Note that the base platform and OS have to match - i.e. today you can run ARM Linux containers on ARM Linux and x64 Linux containers on x64 Linux, but you can't mix and match. When Windows is added, the pattern will be the same - you will be able to run Windows containers on Windows OS, but not on Linux. Not without an extra layer of virtualization (like VirtualBox, VMWare, etc).

    Edit: respect to the Wine answer, which I hadn't considered. It sort-of fits as "an extra layer of virtualization", but at the OS API level not the hardware level. And somewhat restricted in scope of .Net programs supported.

    In a similar vein, you might be able to run your .Net code in Docker using Mono.

    0 讨论(0)
  • 2021-01-01 12:08

    Yes, if you install wine and .NET, here is an example of such a Dockerfile

    https://registry.hub.docker.com/u/justmoon/wix/dockerfile/

    extract

    # Install .NET Framework 4.0
    

    RUN wine wineboot && xvfb-run winetricks --unattended dotnet40 corefonts

    0 讨论(0)
  • 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
    
    0 讨论(0)
提交回复
热议问题