Deploying applications to Windows Server 2016 and Windows Containers.
Delivered at NDC London 2017 on 20th January.
Sponsored by Katacoda.com, interactive learning platform for Docker and Cloud Native platforms.
7. Agenda
• Windows Server 2016
• Building and deploying Windows Containers
• Differences to Linux
• Hyper-V Containers
• Docker API / Kubernetes / Swarm
• Future
19. Windows Hyper-V Containers
Windows Kernel
Windows Server 2016
SQL
Server
MSMQ
IIS /
ASP.NET
Windows Kernel
Windows Utility VM
Hyper-V
Docker Engine
20.
21. Windows Server Core
• Nearly Win32 Compatible
• Same behaviour of Windows
• Install all of the same tooling
22. Windows Nano
• Stripped down
• Smallest footprint
• 1/20th the size of Windows Server Core
• Only essential components
– Hyper-V, Clustering, Networking, Storage, .Net,
Core CLR
23. Windows Server Core => Ubuntu Linux
Windows Nano => Alpine Linux
Windows Server Core => Legacy Apps?
Windows Nano => Modern Apps?
31. PS C:> docker images
REPOSITORY TAG IMAGE ID CREATED
windowsservercore 10.0.10586.0 6801d964fda5 2 weeks ago
windowsservercore latest 6801d964fda5 2 weeks ago
nanoserver 10.0.10586.0 8572198a60f1 2 weeks ago
nanoserver latest 8572198a60f1 2 weeks ago
32. PS C:> docker run -it
windowsservercore cmd
Thank you to https://msdn.microsoft.com/en-
45. > type Dockerfile
FROM microsoft/windowsservercore:10.0.14393.693
RUN powershell.exe Install-WindowsFeature web-server
> docker build –t iis .
46.
47.
48. > type Dockerfile
FROM microsoft/iis:windowsservercore-10.0.14393.693
SHELL ["powershell", "-command“]
49. > type Dockerfile
FROM microsoft/iis:windowsservercore-10.0.14393.693
SHELL ["powershell", "-command"]
RUN Install-WindowsFeature NET-Framework-45-ASPNET; Install-
WindowsFeature Web-Asp-Net45
50. > type Dockerfile
FROM microsoft/iis:windowsservercore-10.0.14393.693
SHELL ["powershell", "-command"]
RUN Install-WindowsFeature NET-Framework-45-ASPNET; Install-
WindowsFeature Web-Asp-Net45
RUN Remove-Website -Name 'Default Web Site';
mkdir c:NerdDinner;
New-Website -Name 'nerd-dinner'
-Port 80 -PhysicalPath 'c:NerdDinner'
-ApplicationPool '.NET v4.5‘
51. > type Dockerfile
FROM microsoft/iis:windowsservercore-10.0.14393.693
SHELL ["powershell", "-command"]
RUN Install-WindowsFeature NET-Framework-45-ASPNET; Install-
WindowsFeature Web-Asp-Net45
RUN Remove-Website -Name 'Default Web Site';
mkdir c:NerdDinner;
New-Website -Name 'nerd-dinner'
-Port 80 -PhysicalPath 'c:NerdDinner'
-ApplicationPool '.NET v4.5‘
EXPOSE 80
52. > type Dockerfile
FROM microsoft/iis:windowsservercore-10.0.14393.693
SHELL ["powershell", "-command"]
RUN Install-WindowsFeature NET-Framework-45-ASPNET; Install-
WindowsFeature Web-Asp-Net45
RUN Remove-Website -Name 'Default Web Site';
mkdir c:NerdDinner;
New-Website -Name 'nerd-dinner'
-Port 80 -PhysicalPath 'c:NerdDinner'
-ApplicationPool '.NET v4.5‘
EXPOSE 80
COPY NerdDinner c:NerdDinner
89. Windows Hyper-V Isolation
• Problem: Shared Kernel
• Solution: Super lightweight virtual machines
• Intel Clear Containers
• Ubuntu LXD
• IBM are working on something
90. PS C:> docker run -it -p 80:80
--isolation=hyperv app cmd
1) Windows starts 'Utility VM‘ and freezes state
2) Forks VM state, brings up a fresh second VM
3) Launches container on VM
91. Properties of Windows Utility VM
• Invisible to Docker and containers
• All writes are degraded
• Separate Kernel to host
• SMB file share to access host data
• In the future used for Linux containers?
105. Host Fingerprinting
• Constraints based deployment
• Container is based on Nano Server, within
cluster, deploy to server capable of running
Nano Server (ie. Windows Server 2016)Host Fingerprinting