This document discusses deploying Docker containers on Windows Server 2016. It provides an introduction to Docker and containers, explains how containers work on Windows, and demonstrates how to deploy common applications like IIS and ASP.NET within Windows containers. It also covers building Windows-based Docker images, running containers in production, and the future of containers on Windows platforms.
17. > docker run –p 6379:6379 redis
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 3.0.3 (00000000/0) 64 bit
.-`` .-```. ```/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 1
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'
1:M 05 Nov 10:42:24.402 # Server started, Redis version 3.0.3
1:M 05 Nov 10:42:24.402 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition.
To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl
vm.overcommit_memory=1' for this to take effect.
1:M 05 Nov 10:42:24.402 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will
create latency and memory usage issues with Redis. To fix this issue run the command 'echo never >
/sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a
reboot. Redis must be restarted after THP is disabled.
1:M 05 Nov 10:42:24.403 # WARNING: The TCP backlog setting of 511 cannot be enforced because
/proc/sys/net/core/somaxconn is set to the lower value of 128.
1:M 05 Nov 10:42:24.403 * The server is now ready to accept connections on port 6379
23. Windows Hyper-V Containers
Windows Kernel
Windows Server 2016
SQL
Server
MSMQ
IIS /
ASP.NET
Windows Kernel
Windows Server 2016
Hyper-V
Docker Engine
24.
25. Windows Server Core
• Nearly Win32 Compatiable
• Same behaviour of Windows
• Install all of the same tooling
26. 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
27. Windows Server Core => Ubuntu Linux
Windows Nano => Alpine Linux
Windows Server Core => Legacy Apps?
Windows Nano => Modern Apps?
28. Work In Progress
• https://msdn.microsoft.com/en-
us/virtualization/windowscontainers/about/w
ork_in_progress
• eg: Windows Containers cannot be
managed/interacted with through a RDP
session in TP4.
36. 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
37. PS C:> docker run -it
windowsservercore cmd
C:> dir
Users Program Files Windows etc
Thank you to https://msdn.microsoft.com/en-
us/virtualization/windowscontainers/quick_start/manage_docker
54. Powershell API
PS C:> Get-ContainerImage
Name Publisher Version IsOSImage
---- --------- ------- ---------
NanoServer CN=Microsoft 10.0.10584.1000 True
WindowsServerCore CN=Microsoft 10.0.10584.1000 True
55. PS C:> New-Container -ContainerImageName
WindowsServerCore -Name demo -
ContainerComputerName demo
Name State Uptime ParentImageName
---- ----- ------ ---------------
demo Off 00:00:00 WindowsServerCore
56. Persisting Data
> docker run –v <host-dir>:<container-dir> image
-v /opt/docker/elasticsearch:/data
-v /opt/docker/mysql:/var/lib/mysql
-v /docker/scrapbook/uploads:/app/public/uploads
-v $(PWD):/host
-v /var/log/syslog:/var/log/syslog
57. Users and Domains
• Local user accounts may be created and used for
running Windows services and applications in
containers
• Containers cannot join Active Directory domains,
and cannot run services or applications as
domain users, service accounts, or machine
accounts.
• "Microsoft are actively looking at solutions to
support these types of scenarios."
61. Linux / Windows
• Linux has cgroups and namespaces
– cgroups – How much access/resources do I have?
– namespaces – What can I see?
• Windows wanted this in the Kernel
• Prototype was called Drawbridge
• Server 2016 Kernel brings in the new
cgroups/namespaces
• Microsoft reached out to Docker to partner
71. 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)
81. Summary
• Docker and Containers have changed how Linux
processes are managed
• Real container support coming to Windows
Kernel
• Automation will be easier
• Better ROI and cluster management