ThomVanL / blog-2021-06-exploring-windows-containers

Jobs, a couple of Silos and the Host Compute Service.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Exploring Windows Containers

Jobs, a couple of Silos and the Host Compute Service.

A little over a year ago I began writing about all the various parts that make up a Linux container. My motivation for doing so was because I thought, and still think, that the "why" is more often discussed as opposed to the “what”. Mind you, I do not think it always necessary to delve into the “what” as long as you are capable of being productive. 🙃

I've always felt very curious to learn more about the technical underpinnings of Windows containers. These details are oftentimes abstracted away from the user, usually for good reason. At any rate, I've wanted to create an equivalent to the "Exploring (Linux) Containers" articles, to highlight some of the things that make this technology possible.

💡 The samples that are discussed in the article were built and tested on an Azure Virtual Machine that supports nested virtualization, with the latest Visual Studio on Windows Server 2019 image from the Azure Marketplace. For more information, have a glance at the following Azure Docs page.

Feel free to read the full blog post!

Samples

  • Applying resource controls using Job objects (C++)
  • Talk to HCS via PowerShell
  • Talk to HCS via .NET language binding with PowerShell
  • Talk to the HCS via .NET languages binding with C# (with stdin, stdout and stderr redirection)

Prerequisites

  • The "Containers feature" should be enabled on your Windows environment.
    • More information on how to do this can be found here.
  • Ensure that base image "mcr.microsoft.com/windows/servercore:ltsc2019" is available.

All samples are known to function with:

  • PowerShell 5.1+
  • Windows Server 2019
  • Visual Studio Community 2019

⚠️ The "Invoke-HcsProcessIsolationSample.ps1" sample requires a .NET standard build of the HCS .NET language binding (dotnet-computevirtualization) to function. The language binding has been included as a Git submodule.

About

Jobs, a couple of Silos and the Host Compute Service.

License:MIT License