【实例简介】]Introduction to Windows Container
【实例截图】






【核心代码】
Introduction................................................................................................................................................ vi
Acknowledgments..................................................................................................................................................................vi
Free ebooks from Microsoft Press ...................................................................................................................................vi
We want to hear from you.................................................................................................................................................vii
Stay in touch............................................................................................................................................................................vii
Chapter 1: Containers 101......................................................................................................................... 1
What is a container? ...............................................................................................................................................................1
Containers versus VMs ..........................................................................................................................................................2
Why containerize? A real-world story .............................................................................................................................3
Container types ........................................................................................................................................................................5
Container host architecture.................................................................................................................................................5
Container management ........................................................................................................................................................6
Container images.....................................................................................................................................................................7
Container networking ............................................................................................................................................................8
Container security....................................................................................................................................................................9
Identity ....................................................................................................................................................................................9
Isolation ............................................................................................................................................................................... 10
Code integrity.................................................................................................................................................................... 11
Code identification and vulnerability scanning.................................................................................................... 11
High availability with containers and container hosts ........................................................................................... 11
Antivirus programs............................................................................................................................................................... 11
Patching containers and container hosts.................................................................................................................... 12
Container OS image........................................................................................................................................................ 12
[Less optimal] Patching a container as a new layer............................................................................................ 13
Chapter 2: Docker 101 ............................................................................................................................. 14
What is Docker?..................................................................................................................................................................... 14iii
Contents
Lightweight......................................................................................................................................................................... 15
Standard .............................................................................................................................................................................. 15
Secure ................................................................................................................................................................................... 15
Docker Enterprise Edition.................................................................................................................................................. 15
Certified Infrastructure, Containers, and Plug-ins............................................................................................... 15
Integrated container management with Docker Datacenter.......................................................................... 16
What is the Docker Universal Control Plane?............................................................................................................ 18
What is Docker Trusted Registry? .................................................................................................................................. 18
DTR architecture............................................................................................................................................................... 18
What is the Docker partnership? .................................................................................................................................... 19
One platform, one journey for all applications......................................................................................................... 20
Developers and IT pros ...................................................................................................................................................... 21
Modernizing traditional applications............................................................................................................................ 21
Deploying monolithic applications as a container .................................................................................................. 22
Docker commands........................................................................................................................................................... 22
What is the Docker client? ................................................................................................................................................ 23
What is a Dockerfile?........................................................................................................................................................... 25
What is Docker Compose?................................................................................................................................................ 25
Getting started: modernize your apps today ............................................................................................................ 26
Language and framework choices ................................................................................................................................. 26
Chapter 3: Deep dive: host deployment ............................................................................................... 28
Deploying a container host/virtual machine (Nano, Core, Windows 10)....................................................... 28
Hardware ............................................................................................................................................................................. 28
Software............................................................................................................................................................................... 29
Deploying a Windows Server 2016 Container host with Desktop Experience ........................................ 30
Deploying a Windows Server 2016 Core container host.................................................................................. 31
Deploying a Windows 10 container host ............................................................................................................... 32
Deploying a Nano Server container host ............................................................................................................... 33
Setting up a Windows Host for Windows Server Containers with Hyper-V Isolation support......... 36
Deploying a Windows Server 2016 container host in Microsoft Azure...................................................... 36
Deploying a base container image................................................................................................................................ 38
Running a sample container............................................................................................................................................. 39
Chapter 4: Deep dive: working with containers................................................................................... 41
Docker client cheat sheet.................................................................................................................................................. 41iv
Contents
Lifecycle................................................................................................................................................................................ 42
Starting and stopping a container ............................................................................................................................ 42
Container resource constraints................................................................................................................................... 42
Container information.................................................................................................................................................... 43
Images .................................................................................................................................................................................. 43
Network ............................................................................................................................................................................... 44
Managing container deployments................................................................................................................................. 44
Listing installed images ................................................................................................................................................. 44
Searching for an image from a repository ............................................................................................................. 44
Pulling images from a repository .............................................................................................................................. 45
Starting and stopping containers .............................................................................................................................. 45
Running commands within a container .................................................................................................................. 47
Committing changes to an image............................................................................................................................. 47
Deleting containers ......................................................................................................................................................... 47
Container resources restrictions................................................................................................................................. 48
Understanding container operations............................................................................................................................ 48
Host information .............................................................................................................................................................. 48
Configuring networking..................................................................................................................................................... 50
Listing networks................................................................................................................................................................ 50
Viewing network information...................................................................................................................................... 50
Creating networks............................................................................................................................................................ 51
Removing networks ........................................................................................................................................................ 52
Port mapping..................................................................................................................................................................... 52
Binding networks to a specific host adapter......................................................................................................... 53
Virtual LANs........................................................................................................................................................................ 53
Dockerfiles ............................................................................................................................................................................... 53
Basic instructions.............................................................................................................................................................. 54
Creating a Dockerfile ...................................................................................................................................................... 55
Pushing the image to the repository ....................................................................................................................... 56
Docker Swarm........................................................................................................................................................................ 57
Initializing a Swarm cluster........................................................................................................................................... 58
Swarm networking........................................................................................................................................................... 59
Deploying services........................................................................................................................................................... 59
Mixed mode clusters....................................................................................................................................................... 60
Docker compose ................................................................................................................................................................... 61
Azure Container Service..................................................................................................................................................... 62v
Contents
Deploying ACS .................................................................................................................................................................. 62
Connecting with an ACS cluster................................................................................................................................. 62
Deploying apps to an ACS solution by using Docker Swarm......................................................................... 62
Docker Swarm continuous integration.................................................................................................................... 62
Service Fabric and containers .......................................................................................................................................... 62
Guest container................................................................................................................................................................. 63
Service Fabric services inside a container............................................................................................................... 63
Deploy Windows Containers on Service Fabric ................................................................................................... 63
Chapter 5: Deep dive: containerizing your application ...................................................................... 64
Methodology.......................................................................................................................................................................... 64
Legacy application considerations ............................................................................................................................ 65
Moving the application.................................................................................................................................................. 67
Tools........................................................................................................................................................................................... 68
Microsoft Visual Studio 2017 ...................................................................................................................................... 69
Visual Studio 2015—Visual Studio Tools for Containers.................................................................................. 69
Docker for Azure .............................................................................................................................................................. 69
Azure Container Service ................................................................................................................................................ 69
.NET Core tools ................................................................................................................................................................. 70
Image2Docker................................................................................................................................................................... 70
Examples .................................................................................................................................................................................. 70
Migrating ASP.NET MVC applications to Windows Containers..................................................................... 70
Running console applications in containers.......................................................................................................... 70
Convert ASP.NET Web Services to Docker with Image2Docker.................................................................... 70
Running SQL Server ASP.NET Core in a container on Linux in Azure Container Services .............. 70
Using Visual Studio to automatically generate a CI/CD pipeline to deploy ASP.NET Core web apps
with Docker to Azure...................................................................................................................................................... 70
About the authors ................................................................................................
网友评论
我要评论