Can docker images run cross-platform?

WBOY
Release: 2022-03-08 14:58:23
Original
6498 people have browsed it

Docker images can run across platforms; as long as the system architecture is the same, the same image can be used. x86 images can only be used on x86 systems, and arm images can only be used on arm systems. Docker images are very important for containers. It just simulates an environment and has little to do with the host machine.

Can docker images run cross-platform?

The operating environment of this tutorial: linux7.3 system, docker-1.13.1 version, Dell G3 computer.

Can docker images run across platforms?

Docker images have nothing to do with the operating system. The greatest value of docker is the image packaging technology. First of all, you understand what docker is, what an image is, and what a container is, and then you can understand the relationship between the image and the operating system. Docker is an engine and a technology based on the kernel. For example, if the Linux kernel is used, it cares whether it is a Linux kernel or not. It does not care whether you are Ubuntu or CentOS. Therefore, docker also achieves decoupling from the operating system. The image is to package the running environment of the service into a package, such as tomcat. In the image, in addition to the kernel of the operating system, the binary package of tomcat is added. Then build a tomcat image through the docker engine. As for containers, for example, if we want to create a tomcat service, the previous method was to install a tomcat in the server through tar or rpm, and then start tomcat; if we want to install multiple machines, we need to manually deploy them multiple times. Now that we have the tomcat image, we can directly use the image to create multiple tomcats (the relationship is that a tomcat image can create multiple tomcat containers - that is, tomcat services), and the containers can be regarded as tomcat processes.

A program needs the support of the operating system to run, and needs to access its own private data and software. Docker is a container that redirects all access to files and operating system APIs, making the application feel like it is running on an independent operating system. Docker intercepts API calls and redirects global access to the operating system. Wrapped so that programs don't actually access them. Because the docker program accesses the API of the container package, theoretically, as long as the API of these containers is implemented on another operating system, the program can be transplanted, because the program does not directly interact with the operating system and cannot sense the different systems. s difference.

Docker’s operating mechanism on various platforms

LINUX: Docker shares the kernel on Linux without virtualization and fully supports native functions. So only linux class docker can be created.

Windows: Docker is on Windows, enabling Hyper-V or virtualization technology (implemented through a virtual machine, without sharing the Windows kernel). Linux-like docker and Windows-like docker can be created.

Mac: Docker is also implemented on mac os using virtualization technology xhyve or virtualbox, and does not share the mac os kernel. Only Linux-like docker can be created, but Mac OSX docker cannot be created.

As long as the system architecture is the same, the same image can be used. For example, x86 images can only be used by x86 systems, and arm images can only be used by arm systems. The docker image only simulates an environment for the container and has little to do with the host machine

Recommended study: "docker video tutorial"

The above is the detailed content of Can docker images run cross-platform?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template