How to Install Roles And Features On A Windows Container

In this article, I’ll show you how I Install Windows Server Roles and Features on a Windows Container running Windows Server 2016 Core.

Installing Windows Server roles on a Windows Container can only be done using PowerShell after the container has started.

Technically, All roles and features are available for Install however some are not applicable and not supported to run on a Windows Container.

In this example, I’ll Install the DNS Server role on new Container.

We could also use a more advanced method like DockerFile which I’ll not cover right now.

In the two articles below you will learn how to Deploy Windows Containers and how to create a Windows Container.

To get started, I’ll create a new Windows Container running Windows Server 2016 Core and I’ll start PowerShell when the Container Is ready.

docker run -it microsoft/windowsservercore powershell

Once the Container Is created, I’ll run the cmdlet below to check which Features and Roles are Installed.

Get-windowsfeature

In my case, I’ll Install the DNS Server role

To Install a Role or Feature, find it In the list above and type the name In the middle section for Install as seen below:

Add-windowsfeature dns

To view Installed roles run the line below to confirm that the Install has completed

Get-WindowsFeature | where installed

In my next article, I’ll explain the difference between Windows Containers and Docker


Posted

in

by