Webinar Recap: The Docker Platform on Windows – from 101 to Modernizing .NET Apps

Elton Stoneman

Apr 04 2018


Our live Docker webinars are always hugely popular. Last month we hosted a session on Docker and Windows containers, covering everything from the basics to how you can use the  Docker platform (Docker Enterprise Edition and Docker Desktop)  to modernize existing .NET apps and move them to the cloud.

The recording is available now – it clocks in at 60 minutes and has lots of demos showing you how to build and run Windows applications in containers with Docker for Windows:

The sample code, Dockerfiles and Docker Compose files for all the demos are here on GitHub.

In fact there were so many demos, I ran out of time for the Q&A part – so here are the unanswered questions we had from viewers:

Q. Are there any best practices or tutorial to architect sql databases in containers? What about data persistence, database references etc? How can we use SSDT with containers?

SQL Server running in a container is just like any remote SQL Server – you can connect with SSDT or Visual Studio or VS Code or any SQL client. There’s a good SQL Server in Docker tutorial on GitHub which walks through the build and deployment process with containers, and we have a Docker Platform Reference Architecture covering storage solutions.

Q. Will there be Docker PowerShell cmdlets available on windows?

The Docker platform runs as a background Windows Service, and it exposes a REST API for managing containers. The Docker command line talks to the API, and Microsoft have provided a Docker PowerShell module which talks to the same API. We advise using the Docker command line though because it’s always up-to-date with the Docker server, and the PowerShell module hasn’t been updated for a while.

Q. Can you please demo running unit tests (MSTest) on a Windows container?

I do this in my video series on modernizing .NET apps with Docker. In the series I demonstrate CI/CD with Docker Enterprise Edition for .NET apps, running end-to-end tests in a container. This example uses NUnit – but the principle is the same for MSTest – and I also use SpecFlow and Selenium to show tests which flex the whole application, running across multiple containers.

Q. Can I run Windows containers on Linux?

No. Windows containers use the underlying operating system kernel of the host, so you need to be running Windows Server 2016 (or Windows 10) to run Windows containers. You can run Linux containers on Windows, using the Hyper-V container feature.

Q. Is there any specific version of Docker that needs to be installed on Windows 10 and Windows 2016? Like Docker for Windows for Windows 10 and Docker Enterprise Edition (EE) for Windows 2016?

That’s exactly right – Docker for Windows is the desktop version you use on Windows 10, it has a bunch of extra features for developers. On Windows Server 2016 you run Docker Enterprise Edition which comes with support for your containers from Microsoft and Docker (the Windows Server licence includes a licence for Docker EE Basic).

Q. I have a .NET Core Web Api and multiple CMS API. How can I create container for this mixture of .NET framework and .NET Core?

You can run multiple apps inside one container, but you shouldn’t. You should build each part of your app (e.g. the API, the CMS and the Web UI) into a separate Docker image and run them in separate containers. That means you can upgrade, scale and deploy each part separately. The Windows Server Core base image from Microsoft includes the full .NET Framework, and there is a .NET Core image built on Nano Server.

Q. Will all 3rd party installers be working in the Docker container?

Not necessarily, it depends on the installer. You can run any command inside a Dockerfile as long as it doesn’t have a dependency on the Windows UI. If you have an MSI which can run unattended (i.e. with no windows popping up), then it will run fine in the Dockerfile using the normal msiexec command.

Q. How to handle containerized executables that depend on updating the container registry?

This is not a problem. Every container has its own copy of the Windows Registry. If you need to make Registry changes during deployment in the Dockerfile, or during runtime in the container, it will only update that container’s Registry, and it won’t interfere with other containers.

Q. Does the container have direct access to frame buffers and hardware (i.e. GPU)? (on Windows)

Not at the moment. Access to host hardware is one area where Windows containers do not have full parity with Linux containers. But Microsoft are investing heavily in container features for Windows Server – there are some big improvements in the Semi-Annual release 1709, and we can expect more when Windows Server 2019 is released.

Learn more about Docker on Windows


One thought on “Webinar Recap: The Docker Platform on Windows – from 101 to Modernizing .NET Apps

  1. I understand that w/o a container UI, you cannot run WPF apps in a container. But you mentioned in another article "That rules out running Windows Forms or Windows Presentation Foundation (WPF) apps in containers (although you could use Docker to package and distribute those desktop apps)".
    How would you go about running the distributed desktop apps?

Leave a Reply