Docker Windows Containers with Docker Enterprise
A huge number of companies are still running apps on Windows Server 2003 and 2008 in the data center. They want to move to a modern, secure, supported platform which gives them the flexibility to run in the data center today – and in any cloud tomorrow. Docker gives them that flexibility, and you can move your apps to Docker without changing any code.
That was the focus of our recent webinar, where we showed several apps currently running on Windows Server 2003, and packaged them to run as Docker Windows containers. We showed all the steps to migrate the apps with no code changes, and then we ran them in Docker Enterprise on a Windows Server 2016 VM running in Azure.
You can watch the full video of the webinar here – it comes in at just over 60 minutes:
In the webinar, you see the portability that Docker Enterprise gives you. The applications we move are a mixture of older web technologies – static HTML, classic ASP and ASP.NET WebForms. The apps from the demo and the Dockerfiles are on GitHub here
. They could be 15-year old apps and you can run them in Docker containers with no code changes.
Portability is just the first part of the Docker migration story. You get increased density from containers, running more apps on less infrastructure, with a much smaller Windows licensing footprint. You get the security of running the latest version of Windows and you get a whole new security workflow – the secure software supply chain, which we’ll cover in a future webinar.
Questions from the Webinar
We finished the webinar with a Q&A where we had some really great questions from the audience. I didn’t have time to answer them all, so here’s the full set of responses.
Q: Is it real containerization when we run Docker on Windows or is it communication via APIs
It’s real! Docker and Microsoft worked together for the Windows Server 2016 release in September of 2016 to add container support to the Windows kernel. When you run a Docker Windows container which serves an IIS website, you can see the w3wp.exe worker process running on the host Windows server – it’s process-level isolation.
Q: Can we read/write from Azure Storage from Docker Windows containers?
Yes. Docker is a new way to run your apps, but whatever your apps do inside is the same when placed in a Docker container. Docker Windows containers running in Docker Enterprise have the same network access as the host server, so you can reach Azure Storage from a cloud VM or the datacenter.
Q: How do I know which Microsoft base server and features to use (Server Core vs Nano, ASP, dotnet etc)? Do I need to know my app in detail for this? Is there any easy way to identify this for my Windows Apps in case I’m new to my app and want to move it to a Docker this way?
The first decision is between Windows Server Core – which is pretty much the full Windows Server 2016 experience minus the UI, and Nano Server – which only supports 64-bit apps and certain application runtimes.
If you know what runtime your app uses, then you can use a Microsoft image which builds on one of those – for .NET Framework or .NET Core. Otherwise, you can write a Dockerfile which replicates your current deployment process. Check out this blog post on How to Dockerize Windows Apps
which goes into more detail.
Q: Say I want to deploy VMs where people can RDP in and run Excel, would that work with Windows Server Core?
No. There’s no Windows UI in the Server Core container image. Docker is for running server applications where there is no graphical UI – web servers, REST APIs, databases, console applications. Microsoft recently announced a new Windows Docker image which does support GUI apps, but it’s not clear if that will support RDP.
Q: Can you talk about WinForm and WPF applications?
They’re not suitable for Docker containers right now, because the Windows GUI subsystem isn’t supported in containers. You can use Docker to build and distribute those apps, but you can’t run Windows client apps in containers.
Q: Can you please elaborate on how to change the old-style configuration (XML) to new Environment variables? Should we change the old application? Or write an intermediate app that constructs the XML from the Env variables?
The best option is to stick with the .NET configuration model and use XML files, so you don’t have to change your app. You can package a default configuration file for development in your Docker image, so devs can run the app just by running a container with no extra setup. Then you can save the production XML file as a Docker config object in the cluster, and apply it to the container when it runs. Check out the video series on Modernizing .NET Apps for IT Pros
which covers all this.
To learn more about Windows Docker containers: