官术网_书友最值得收藏!

  • Docker on Windows
  • Elton Stoneman
  • 396字
  • 2021-07-02 19:53:15

Docker and Windows containers

Docker originally ran on Linux, taking advantage of core Linux features but making it simple and efficient to use containers for application workloads. Microsoft saw the potential and worked closely with the Docker engineering team to bring the same functionality to Windows. Windows Server 2016 and Windows 10 are the first versions of Windows that can run Docker containers. Right now, you can run only Windows containers on Windows, but Microsoft is adding support for Linux containers to run on Windows too.

There is no integration between containers and the Windows UI, though. Containers are only for server side applications - workloads like websites, APIs, databases, message queues, message handlers, and console applications. You can't use Docker to run a client app, like a .NET WinForms or WPF application, but you could use Docker to package and distribute the application, which would give you a consistent build and release process for all your apps.

There is also a distinction between how containers run on Windows Server 2016 and Windows 10. The user experience for working with Docker is the same, but the way containers are hosted is different. On Windows Server, the process that serves your application actually runs on the server, and there's no layer between the container and the host. In the container, you may see w3wp.exe running to serve a website, but that process is actually running on the server - if you had ten web containers running, you would see ten instances of w3wp.exe in task manager on the server.

Windows 10 doesn't have the same operating system kernel as Windows Server 2016, so in order to provide containers with the Windows Server kernel, Windows 10 runs each container in a very light VM. These are called Hyper-V containers, and if you run a web app in a container on Windows 10, you won't see w3wp.exe running on the host - it's actually running inside a dedicated Windows Server kernel in the Hyper-V container.

It's good to understand this distinction. You use the same Docker artifacts and the same Docker commands on Windows 10 and Windows Server 2016, so the processes are the same, but there is a slight performance hit in using Hyper-V containers on Windows 10. Later in this chapter, I'll show you the options for running Docker on Windows, and you can choose the best approach for you.

主站蜘蛛池模板: 新晃| 尤溪县| 潜江市| 韩城市| 景泰县| 陵川县| 五台县| 盱眙县| 西乌珠穆沁旗| 牡丹江市| 酉阳| 南江县| 宣威市| 连城县| 隆化县| 瓮安县| 滁州市| 沾益县| 延庆县| 昌乐县| 鄯善县| 浠水县| 阜康市| 德兴市| 诸暨市| 金塔县| 丰县| 迭部县| 仪征市| 辽源市| 博罗县| 拉萨市| 威宁| 运城市| 桦川县| 浮梁县| 宁津县| 奉节县| 平谷区| 延川县| 葵青区|