当前位置:网站首页>1. Virtualization and container technology
1. Virtualization and container technology
2022-07-22 21:12:00 【Hehe 1112】
Docker yes ⼀ A software based on container virtualization technology , So we're learning about it Docker Conceptual knowledge and make ⽤⽅ Before the law , Virtualization and container technology are indispensable basic knowledge .
virtualization
Virtualization technology is to abstract computer physical resources 、 Convert virtual computer resources to programs for use . The computer resources here include the storage resources of the hard disk 、CPU Control and computing resources 、 Network transmission resources of network card, etc .
In the implementation of virtualization , What needs to be mentioned again is the virtual machine . The so-called virtual machine , Generally speaking, it is through ⼀ Virtual machine monitors ( Virtual Machine Monitor ) Facilities to isolate the operating system from hardware or should ⽤ Programs and operating systems , In order to achieve virtualization ⽬ Of . The virtual machine monitor sandwiched in it , Often referred to as Hypervisor. Virtual machines isolate programs and operating systems , Convert the instructions of the program into what the current operating system platform can execute ⾏ Instructions , Reached no ⽤ Proceed to the program ⾏ Any modification can be executed ⾏ Of ⽬ Of . That's why Java virtual machine JVM,PHP virtual machine HHVM Wait for these words ⾔ All programs have ⾮ Chang strong cross platform .
When all instructions must be processed by the virtual machine monitor . That means , The performance of virtual machine is low , For example, transportation ⾏ stay ZendVM perhaps HHVM Medium PHP Program , Although all the code is compiled into Opcode code , But it is still through the virtual machine that it is finally converted to the machine code that the machine can recognize ⾏. This inefficiency is sometimes ⽆ Legally tolerable , To solve this problem , Real virtual machine programs often don't follow exactly Design structure of virtual machine ,⽽ Yes, it is ⼊⼀ Some other technology to solve the problem of efficiency . for example , stay VMware Workstation、Xen We can see how hardware assisted virtualization makes ⽤, By letting instructions go directly ⽀ Virtualized hardware , In order to avoid the inefficient Hypervisor.⽽ Such as JRE、HPHP in , In addition to based on Hypervisor Explanation of implementation ⾏ Outside the mechanism , And just in time compilation ( Just In Time ) shipment ⾏ Mechanism , Let the program code run ⾏ Precompiled into machine code that conforms to the current hardware platform , such ⽅ Formula is no longer in the scope of virtualization .
Container technology
In terms of classification or implementation , Container technology should belong to the category of system virtualization , That is, the operating system provides virtualization support . The so-called container technology is to enable applications to run in an independent environment without interference , This independent running environment is like a container that wraps the application .
The performance of container technology is much better than that of other virtualization implementations such as virtual machines , Because container technology does not require the conversion of instructions . Because there is no instruction conversion , Therefore, applications running in containers must support running on real operating systems . So container technology does not solve the problem of cross platform compatibility , It's not really virtualization technology , But the container provides a relatively independent application running environment and resource control functions , It can be attributed to the implementation of incomplete virtualization technology .
Because there are no two levels of virtual operating system and virtual machine monitor ,⼤ The amplitude is reduced ⽤ Program sequence ⾏ Additional consumption .
To be more precise , All in containers should ⽤ The program actually runs completely ⾏ In the host operating system , And other real luck ⾏ Among them should ⽤ The program is running on instructions ⾏ layer ⾯ There is no difference at all .
Since the program in the container needs to run in the host operating system , that docker How to achieve cross platform ?
docker It is based on container technology , but docker It is cross platform .
docker It's an engine , Is a kernel based technology . such as Linux kernel , Then it only cares about whether Linux kernel , It doesn't care if you are Ubuntu still CentOS. therefore docker It is also decoupled from the operating system . And in the docker The process in the container of is running directly in the host kernel , Is not directly dealing with the operating system .
Suppose the host is Ubuntu, The container is CentOS.CentOS The process in the container will direct to Ubuntu The host kernel sends syscall, And will not directly or indirectly use any Ubuntu Of userland The library of .
This is fundamentally different from virtual machines , A virtual machine is a virtual environment , Virtualize a set of physical devices on the existing system , Then run an operating system kernel of the virtual environment in the virtual environment , Run the whole system on top of the kernel , And call the process inside .
Consider the above example , In the virtual machine ,CentOS The process of sending syscall The kernel calls , The request will be sent by CentOS The kernel of receives , then CentOS When the kernel accesses virtual hardware , Intercepted by the service software of the virtual machine , And use the host system , That is to say Ubuntu Kernel and userland To execute .
边栏推荐
猜你喜欢
BUUCTF闯关日记--[MRCTF2020]你传你呢(超详解)
浅谈 filter伪协议的特性
Chapter 1: Minio introduction and installation
BUUCTF闯关日记--[SUCTF 2019]CheckIn1()
Buctf passing Diary - - [Netting Cup 2020 Qinglong Group] areuserialz
Thread pool 01 -- basic use
Nssctf-01-[swpuctf 2021 freshman competition]gift_ F12
第七章:使用jwt token的方式来进行登录
MATLAB2017a环境下使用libsvm-3.23出现的问题与解决方案
BUUCTF闯关日记02--[HCTF 2018]WarmUp1
随机推荐
Use VBScript on xshell and CRT to connect and locate servers, directories and databases more efficiently
BUUCTF闯关日记02--[HCTF 2018]WarmUp1
How many holes are there in string split operation
Buuctf entry diary -- [nctf2019]fake XML Cookbook
PKG config lookup library and for compilation
使用vis-network根据节点坐标定位环形工具栏
MVCC
Chapter 6: EASYCODE code generator
Style writing in next
Bash基本功能—通配符和其他特殊符号
Write a 3D banner using JS
微信小程序综合案例实践2
Buuctf breakthrough diary -- [netding cup 2020 Qinglong group]areuserialz
Nssctf-01-[swpuctf 2021 freshman competition]gift_ F12
Pytorch custom data set loading (label in CSV file)
Solve the problems that tracepass website cannot be opened and stackoverflow is not fully displayed
Juc-6.3-concurrency container queue
JUC-7.2-线程协作-Condition
微信小程序入门教程学习笔记——UI篇之操作反馈
[lttng learning journey] - trace control -- advanced