SJDoodle
SJDoodle

Reputation: 367

Docker running Windows applications

I understand Docker to be a containerization tool, with a limited set of APIs so as to be platform agnostic. I am trying to understand what limitations it places on typical Windows development. For example, does it limit access only to write to a file system (and therefore rules out applications that write to the registry)? Is there a level of complexity where Dock is not suitable (but then again I heard that MSSQL will be supported on docker)?

Upvotes: 5

Views: 7805

Answers (2)

VonC
VonC

Reputation: 1328282

Note: since then, you have "How to run lightweight Windows Containers on Windows 10" (January 2019, 2+ years later), from Stefan Scherer.

It does point out that, with the latest release of Docker Desktop (2.0.0.2+) on Windows 10 1809 you now can run Windows Containers in process isolation mode

In the past process isolation was only possible with Windows Server.
The Windows 10 operating system uses the same kernel, but with different settings.
With this pull request moby/moby PR 38000 that got merged into Docker 18.09.1 it is now possible to use it on Windows 10 as well.

  • You can start more Windows Containers on your machine as they consume less resources
  • Containers normally start faster than in hyperv isolation mode
  • You can "see" the isolated processes and what they are doing

Especially for developers this is a great enhancement, because you now can use tools like Task Manager, Process Monitor and others to inspect your container processes from the host

The only caveat using the process isolation mode is that the Windows base image that is used for a Docker image must match the kernel of your Windows 10 machine.

Open up a PowerShell terminal and start a Windows container with this command

docker run -d -p 8080:8080 --isolation=process chocolateyfest/appetizer:1.0.0

https://stefanscherer.github.io/content/images/2019/01/windows-10-process-isolation.png

As you can see in the screen shot you can see the node.exe process in the Task Manager.
If you have the Sysinternals Process Monitor installed you also can see what the containerized process is doing.

This is great when you create an own Docker image from your or a 3rd-party app and something doesn't work as expected or the exe file just doesn't want to start inside the container.

Upvotes: 7

Roman
Roman

Reputation: 20256

This question is really broad, and hard to answer definitively, but a few specific points in it can be addressed.

I understand Docker to be a containerization tool, with a limited set of APIs so as to be platform agnostic.

It's platform agnostic in a sense that you could run a container on CentOS, Ubuntu, or any other Linux distribution, but you can't run a Linux container on Windows natively, or a Windows container on Linux natively. Introducing Docker for Windows Server 2016 is a good place to start with information regarding Windows containers.


For example, does it limit access only to write to a file system (and therefore rules out applications that write to the registry)?

Based on this MSDN FAQ, no (emphasis mine)

Windows Server Containers are a lightweight operating system virtualization method used to separate applications or services from other services running on the same container host. To enable this, each container has its own view of the operating system, processes, file system, registry, and IP addresses.

For example, dockerfile for SQL Server Express image modifies the registry.


Is there a level of complexity where Dock is not suitable

The question isn't about complexity but about availability of APIs. This is also from the above mentioned Docker for Windows Server 2016

With the exception of GUI apps and apps requiring Windows Remote Desktop, most apps that run on Windows Server can be dockerized to run in an image based on microsoft/windowsservercore with minimal effort.

Upvotes: 1

Related Questions