I am running Docker for Windows (version 18.09) on Windows Server 2016. I would like to build an image to run a .NET Framework app. Visual Studio 2015 produced the following artifacts
Don’t use any prebuilt images unless they are provided by well established player which will rebuild those monthly. If I was you I would just start with plain dotnetframework image. Install mspdeploy and then run it inside dockerfile. But ultimately the best thing to do is to decouple all your artifacts from msdeploy to actual stuff which is required and install only those things since all msdeploy is doing is packaging your software. If you rely on msdeploy your image will be bigger and still will hide all the details about your app, while one of the benefits of docker in general is that Dockerfile itself provides documentation about how your application is built from ground up.
Once you have container running go into container via docker exec -it <containerid> powershell and after that you shall administer application just as you would on server core image from command line. Also there is already website existent in that base image, so find where it points to and copy files there into inetpub folder.
I’m having trouble understanding your suggestion. Could you please do me a favor and fix my Dockerfile? Basically, I have a folder with a bunch of files and I want to put a site on it. Thanks
To deploy classic ASP.NET applications into docker images I use the Microsoft IIS image (mcr.microsoft.com/windows/servercore/iis) and install MSDeploy agent. Then I deploy the application knowing it will fail, when it does, correct the ACL and deploy again, which will be successful and then the image is ready for use.
Note: this is an “impure” container use case and you would be better to re-engineer as dotnet core with Kestrel, but it’s pragmatic.