In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "can you use Docker on the Windows system?" the content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "can you use Docker on the Windows system"?
Docker, or rather, container technology, has almost become the default technology for application distribution and cluster deployment in recent years. The maturity of Docker ecology also depends on the rise of its surrounding tools and practice models. For example, choreography techniques that have sprung up after a spring rain, and DevOps practices based on container technology are carried out on a large scale.
So can such a good technology be used on Windows? On various occasions, someone has discussed this topic with me. Every time I hear such a question, I am also very helpless. After all, as long as a little search, it is not difficult to answer: yes. However, when you think about it, it is reasonable to have such a question: after all, Docker is a technology that originated on Linux.
Docker is a light virtualization technology abstracted based on Linux's built-in isolation mechanisms such as Namespace and CGroup. Compared with the virtual machine, it realizes the isolation of the running space in a lightweight way. If the physical machine is a residential building, the virtual machine is the suite in the building, and the container technology is the partition in the suite. It is not difficult to understand that Docker, as a partition, cannot provide a virtualized runtime environment based on one kernel (Linux) for another kernel (Windows). Therefore, Linux-based Docker does not support running Windows applications.
Long before Docker, Linux provided the basic technologies used by Docker today. Behind the sudden popularity of Docker around the world overnight, the accumulation of technology was not completed in an instant. All this seems to lag behind on Windows. At a time when Docker is already well known, Windows systems do not have a similar mechanism at all, let alone Windows's unique tool chains and practices. Therefore, we can see that the early intersection of Windows and Docker only provides an application development environment for it.
Boot2docker and Docker for Windows
Applications for Docker deployment can be developed in Windows-the desktop experience of Windows is much better than that of Linux, so there are early projects to run Docker as virtual machines on heterogeneous operating systems, namely boot2docker. It supports both Windows and macOS.
Later, Docker began to launch its own Docker for Windows toolkit, which aims to provide developers with a complete tool chain for developing Docker-oriented applications on Windows, including the runtime environment, clients, Docker Swarm orchestration tools and other tools. The tool in Docker for Windows responsible for the configuration of the running environment is Docker Machine. Similar to boot2docker, Docker Machine creates a Linux virtual machine on Windows to run the Docker engine. In other words, this environment only supports the application format of Linux and does not support the running of Windows applications.
Docker for Windows running on Windows (picture from Docker document)
Windows container technology
Just as the container technology of the Linux world is blowing all over the world by the east wind of Docker, the Windows system has also discovered the importance of container granularity. Microsoft and Docker announced a partnership in 2014 to bring container technology to the Windows Server operating system and provide more direct support for the containerization of traditional Windows applications. Soon after, Microsoft announced on Ignite 2015 that it would launch Windows Nano Server; optimized for containers. The first real meeting with developers of the Windows container was on the annual update of Windows 10 (2016.8), which officially provided the development environment for Windows containers. The version of Windows Server 1709 released in October 2017 includes Windows containers, meaning that the technology can be used in production environments. Windows container is a container technology that can really run Windows applications, including applications that rely on a large number of Windows features such as IIS, registry, and so on, can run in Windows containers.
Although Windows's support for containers is belated, the community's attention to and use of Windows containers is extremely active. This is mainly due to the ecological maturity of the container technology itself. on the one hand, people have a full understanding of this technology, and the surrounding tools and practices have become increasingly perfect. On the other hand, in the process of building this technology with Docker, we also paid attention to the compatibility with the existing technology. It has been found that after enabling the Windows Container function on the computer, the next steps are still based on the Docker client, and the command line parameters are no different from the Docker on Linux.
Almost with the mature process of Windows container technology itself, the support of peripheral tools for Windows container is also improving. Docker for Windows has added an intimate menu in the new version to switch between Linux containers and Windows containers. Kubernetes has added support for Windows containers since version 1.5. In terms of cloud environments, many cloud environments, including Azure and AWS, provide Windows container support for the first time.
Toggle container runtime
Windows Container Architecture
How does Windows provide both its own container technology and a Docker-compatible operation interface? The upper figure below shows the architecture of the Linux container, and the following figure shows the architecture of the Windows container. It can be found that the two structures are very similar. Similar to Linux, Windows abstracts out the concepts of CGroup and Namespace, and provides a new level of abstraction, Compute Service, host computing service (Host Compute Service,hcs). Hcs aims to provide a more stable interface for external operations, such as Docker engines, compared to implementation details that may be refactored frequently at the underlying level. The operation interface of hcs is currently available in Go and C #, which is currently used to manipulate Windows containers in Docker clients.
The picture is from Black Belt's speech at DockerCon: the Secret of Docker and Windows containers
In terms of container images, Microsoft itself provides two server versions: Server Core and Nano Server. Server Core can be understood as Windows Server removes the part of GUI, so it has more complete functions (such as file server, DNS server and other functions) and larger image size (2GB~5GB). While Nono Server is a mini system optimized for containers, it only contains the core Windows server functions, and the image size is (130MB~400MB). The method of building your own image based on the base image is the same as the Linux image, so the format and syntax of the DockerFile file are no different. In terms of authorization, Microsoft will not charge users a separate authorization fee for container images as long as the user has obtained the authorization of the host.
Summary
Container technology itself and a series of tools and practices around it standardize the packaging and distribution of applications, which can largely eliminate the dependence of applications on specific environments, thus providing a strong guarantee for efficient cluster deployment and operation and maintenance. As a representative of container technology, Docker can run on Windows in two forms: a container in Linux format as a Hyper-V virtual machine, or a native Windows container. The former runs applications in Linux format, while the latter can run Windows applications. With a little bit of skill, you can also run both on Windows computers.
Both Windows 10 and Windows Server provide support for Windows containers, and various containerization tools are improving their support for Windows containers. When developing new applications based on Windows, on the one hand, we can give priority to the ability of cross-platform containerization deployment, on the other hand, we can also consider the use of Windows container technology to achieve containerization and cloud native features like stock applications.
Thank you for your reading, the above is the content of "can you use Docker on the Windows system?", after the study of this article, I believe you can use Docker on the Windows system have a deeper understanding of this problem, the specific use of the situation also needs to be verified by practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.