Chen Bucheng I 2022-06-24 07:17:42 阅读数:729
Docker Belong to Linux An encapsulation of a container , Provide easy to use container interface . It's the most popular Linux Container solution .
Docker Dependence of an application on that program , Package it in a file . Run this file , A virtual container will be generated . The program runs in this virtual container , It's like running on a real physical machine . With Docker, You don't have to worry about the environment .
On the whole ,Docker The interface is fairly simple , You can easily create and use containers , Put your application in a container . Containers can also be version managed 、 Copy 、 Share 、 modify , It's like managing common code .
Docker Main purpose of , At present, there are three categories . 1. Provide a one-time environment . such as , Test others' software locally 、 Provide the environment for unit testing and building during continuous integration .
2. Provide flexible cloud services . because Docker The container can be opened and closed , It is very suitable for dynamic expansion and reduction .
3. Build a microservice Architecture . Through multiple containers , One machine can run multiple services , So we can simulate the microservice architecture on our own .
Docker The three concepts of ： structure 、 transport 、 function
It's like Docker The same icon as , It carries a lot of containers . We can think of the host as this whale , Consider isolated containers as containers , Each container contains its own application . The whale may represent the founder Solomon Hykes The vision of the Internet in my eyes , It's like 20 century 50 In the s, containers overturned the global mode of material transportation , It will revolutionize the way information is transported , Let the goods on the Internet train 、 automobile 、 There is no obstruction between ships .
Docker Be similar to cs structure , A daemon serves as the server , Command as client , Users take client To operate the server .
Mirror image （Image） It's like a virtual machine , It's the same as a virtual machine , It's just that the components are different . Simply put, you must have an image to start a container
Containers （Container） docker It's the container that runs the business , It's like running a kvm Virtual machines are the same . A container is actually an instance created from an image . We can add, delete, modify and query the container , Containers are also isolated from each other . The biggest difference between virtual machines and virtual machines is that one is virtual and the other is isolated .
Warehouse （Repository） Like Baidu network disk , We need a warehouse to store images ,Docker Official provides public image warehouse ; From the perspective of security and efficiency, we can also deploy private environments Registry Or is it Harbor.
Minutes of class
The hard disk to use （ Image size ）
It's usually MB
It's usually GB
Close to the original
A single machine supports thousands of containers
Generally dozens of them
advantage ： Fast start Light weight , Each mirror is very small Light isolation , Each container is isolated , Mutual indifference
shortcoming ： Container isolation is not as strong as virtualization share linux kernel , There are congenital defects in safety selinux It's hard to control Monitoring containers and container troubleshooting is a challenge
copyright：author[Chen Bucheng I]，Please bring the original link to reprint, thank you. https://en.javamana.com/2022/175/20210702150335375i.html