Windows container requirements

This guides list the requirements for a Windows container Host.

OS Requirements

  • The Windows container feature is only available on Windows Server 2016 (Core and with Desktop Experience), Nano Server, and Windows 10 Professional and Enterprise (Anniversary Edition).
  • The Hyper-V role must be installed before running Hyper-V Containers
  • Windows Server Container hosts must have Windows installed to c:. This restriction does not apply if only Hyper-V Containers will be deployed.

Virtualized Container Hosts

If a Windows container host will be run from a Hyper-V virtual machine, and will also be hosting Hyper-V Containers, nested virtualization will need to be enabled. Nested virtualization has the following requirements:

  • At least 4 GB RAM available for the virtualized Hyper-V host.
  • Windows Server 2016, or Windows 10 on the host system, and Windows Server (Full, Core) or Nano Server in the virtual machine.
  • A processor with Intel VT-x (this feature is currently only available for Intel processors).
  • The container host VM will also need at least 2 virtual processors.

Supported Base Images

Windows Containers are offered with two container base images, Windows Server Core and Nano Server. Not all configurations support both OS images. This table details the supported configurations.

Host Operating System
Windows Server Container
Hyper-V Container
Windows Server 2016 (Standard or Datacenter)
Server Core / Nano Server
Server Core / Nano Server
Nano Server
Nano Server
Server Core / Nano Server
Windows 10 Pro / Enterprise
Not Available
Server Core/Nano Server

Nano Server vs. Windows Server Core

Como escolher entre o Windows Server Core e o Nano Server? Você pode criar com o que preferir, mas se achar que seu aplicativo precisa de compatibilidade total com o .NET Framework, então você deve usar o Windows Server Core. Por outro lado, se o seu aplicativo foi criado para a nuvem e usa o .NET Core, você deve usar o Nano Server. Isso porque o Nano Server foi criado com a intenção de ter o menor volume possível, portanto, várias bibliotecas não essenciais foram removidas. Se você estiver pensando em criar com base no Nano Server, é importante lembrar que:

  • A pilha de atendimento foi removida
  • O .NET Core não está incluso (mas você pode usar a imagem do .NET Core Nano Server)
  • O PowerShell foi removido
  • A WMI foi removida

Essas são as maiores diferenças e não uma lista completa. Há outros componentes não listados que também estão ausentes. Lembre-se de que você sempre pode adicionar camadas no topo do Nano Server conforme desejar. Para ver um exemplo disso, confira o Dockerfile do .NET Core Nano Server.

Correspondendo a versão de Host do contêiner com versões de imagem de contêiner

Windows Server Containers

Because Windows Server Containers and the underlying host share a single kernel, the container’s base image must match that of the host. If the versions are different the container may start, but full functionally cannot be guaranteed. Therefore mismatched versions are not supported. The Windows operating system has 4 levels of versioning, Major, Minor, Build and Revision – for example 10.0.14393.0. The build number only changes when new versions of the OS are published. The revision number is updated as Windows updates are applied. Windows Server Containers are blocked from starting when the build number is different - for example 10.0.14300.1030 (Technical Preview 5) and 10.0.14393 (Windows Server 2016 RTM). If the build number matches but the revision number is different, it is not blocked from starting - for example 10.0.14393 (Windows Server 2016 RTM) and 10.0.14393.206 (Windows Server 2016 GA). Even though they are not technically blocked, this is a configuration that may not function properly under all circumstances and thus cannot be supported for production environments.

To check what version a Windows host has installed you can query HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion. To check what version your base image is using you can review the tags on the Docker hub or the image hash table provided in the image description. The Windows 10 Update History page lists when each build and revision was released.

In this example 14393 is the major build number and 321 is the revision.

Windows PowerShell
Copyright (C) 2016 Microsoft Corporation. All rights reserved.

PS C:\Users\Administrator> (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\').BuildLabEx
14393.321.amd64fre.rs1_release_inmarket.161004-2338

Hyper-V Isolation for Containers

Windows Containers can be run with or without Hyper-V isolation. Hyper-V isolation creates a secure boundary around the container with an optimized VM. Unlike standard Windows Containers, which share the kernel between containers and the host, each Hyper-V isolated container has its own instance of the Windows kernel. Por isso, você pode ter diferentes versões do sistema operacional no host do contêiner e na imagem (veja abaixo da matriz de compatibilidade).

Para executar um contêiner com isolamento do Hyper-V, basta adicionar a marca "--isolation=hyper-v" ao seu comando docker run.

Matriz de compatibilidade

Windows Server builds after 2016 GA (10.0.14393.206) can run the Windows Server 2016 GA images of both Windows Server Core or Nano Server in a supported configuration regardless of the revision number.

It is important to understand that in order to have the full functionality, reliability and security assurances provided with Windows updates you should maintain the latest versions on all systems.