4.0 KiB
class: title
Windows Containers
Objectives
At the end of this section, you will be able to:
-
Understand Windows Container vs. Linux Container.
-
Features of Docker for Windows for choosing architecture.
-
Run other container architectures via QEMU emulation.
Are Containers just for Linux?
Remember that a container must run on the kernel of the OS it's on
-
This is both a benefit and a limitation.
-
Since 2013 Docker launch, many OS's have added support for the Docker runtime.
-
We can now run more than "amd64/linux": including Windows, ARM, i386, IBM mainframes, and more, but no macOS or iOS yet :/
--
-
Docker Desktop (macOS/Win) has a emulator too for ARM/PPC and others
-
Later, try running a Raspberry Pi (ARM) or PPC container
History of Windows Containers
-
Early 2016, Windows 10 gained support for running Windows binaries in containers.
-
These are known as "Windows Containers"
-
Win 10 expects Docker for Windows to be installed for full features
-
These must run in Hyper-V mini-VM's with a Windows Server x64 kernel
-
No "scrach" containers, so use "Core" and "Nano" Server OS base layers
-
Since Hyper-V is required, Windows 10 Home won't work (yet...)
-
--
-
Late 2016, Windows Server 2016 ships with native Docker support
-
Installed via PowerShell, doesn't need Docker for Windows
-
Can run native (without VM), or with Hyper-V Isolation
-
Windows Containers Cont.
Windows is largely playing catch up with Linux but moving fast!
You can now do things on Windows you can't do on Linux:
LCOW: "Linux Containers on Windows"
-
Came with the (Fall 2017 Creators Update)
-
Run Linux and Windows containers side-by-side on Win 10
-
No longer required to switch to "Linux Containers"
--
Docker for Windows Users, Start Your Engines:
docker pull microsoft/nanoserver:1803
--
Doh! We need to switch to Windows Containers mode (do that now)
Run Both Windows and Linux containers
-
Run a Nano Windows Server (minimal cli-only server)
docker run --rm -it microsoft/nanoserver:1803 powershell Get-Process exit -
Run a Busybox Linux in LCOW
docker run --rm --platform linux busybox echo hello
(You'll notice nothing in Hyper-V but they are there, hidden Nano and "LinuxKit" VMs)
Did We Say Things Move Fast
-
Things keep improving. Now
--platformdefaults towindows, some images support both-
golang, mongo, python, redis, hello-world, and more being added
-
You should still use
--plaformwith multi-os images to be certain
-
-
Windows Containers now support
localhostaccessable containers (July 2018) -
Microsoft (April 2018) added Hyper-V support to Windows 10 Home, so stay tuned for Docker support, maybe?!?
Other Windows Container options
Most "official" Docker images don't run on Windows yet
Places to Look:
-
Hub Official: https://hub.docker.com/u/winamd64/
-
Microsoft: https://hub.docker.com/r/microsoft/
SQL Server? Choice of Linux or Windows
-
Microsoft SQL Server for Linux 2017 (amd64/linux)
-
Microsoft SQL Server Express 2017 (amd64/windows)
Windows Tools and Tips
-
PowerShell Tab Completion: DockerCompletion
-
Best Shell GUI: Cmder.net
-
Good Windows Container Blogs and How-To's
-
Dockers DevRel Elton Stoneman, Microsoft MVP
-
Docker Captian Nicholas Dille
-
Docker Captain Stefan Scherer
-
