docker popular understanding

        I have bought servers, recently set up a good website, you want to engage in a site, but can only modify the port, and then deploy another site. Cumbersome configuration operating environment, migration sites, make you feel very cumbersome? Server not want to use, and would like to move to another server to be deployed, first copy the original data on the new server deployment environment began to build, these time-consuming things now only takes a few minutes to complete, and that is docker technology.

        docker popular according to their own understanding, it is the virtual technology similar to VM virtual machine the same. But it is more powerful than the virtual machine, small size, fast startup and shutdown only takes a few seconds. Compared to ordinary virtual machine, the start-up time in minutes level, large memory footprint. So this is after docker appears advantage. docker container can be packaged as an image file (similar to those of the snapshot file VM virtual machine) migration when we only need to install on the new server docker, will be able to import the package before the good image file to docker inside, run container, you can for access, does not need to reconfigure the environment. The following figure shows the difference between a common virtual machine and the docker. 

        VM virtual machine:

 

          docker Chart:

    

                  We compare, docker and in fact, the purpose of the virtual machines are similar virtualization technology. But docker is more lightweight than the virtual machine, faster, and more portable.

                        Mirror :  Create a virtual machine and docker are essential things. Virtual machines used friends all know, come to create a virtual machine operating system to download the ISO image file, and then install the operating system through the image file, and a similar physical machine, and then be able to install all the software in a virtual machine.

                         容器:  通俗拿VM虚拟机和docker来举例,一个容器就类似于一个虚拟机,只不过在docker技术的术语上称为容器。这个容器装的就是我们部署的应用在运行,和虚拟机一样可以开机,关机,重启。docker称为容器的运行,关闭,重启。而且这个容器可以打包为镜像文件,类似虚拟机快照的文件,放在其它虚拟机上又可以保持原样能运行,docker也是如此,把容器打包为镜像文件,然后在新的服务器安装好的docker环境下导入进去,保持原来的状态能够运行。

                  透过现象看本质:

                 1、docker容器实际上就是运行的一个进程,只不过由于docker帮助我们包装了这个进程,给这个进程加以一个可运行的微linux环境而已,让我们感觉看起来"像"虚拟机而已。所以也就不奇怪,为什么容器的启动是秒级的,启动一个虚拟机是分钟级别的。

                2.  举个简单例子。一个房子比较大,假如租户一起住,大家一起住难免有束缚感,也不太方便。那么房东把房子改造一下,房子用可拆装的墙板隔离开来,分为许多的小房间,每个人住在自己的小房间。小房间麻雀虽小,五张俱全,你可以自己布置自己的房间。每个租客在自己的"小房间"里面可以做自己的事情,从而也不会打扰到其他人。但是他们都是共享这个房子的水费,电费,网费等公共资源(每个docker容器(也就是进程)依赖的是宿主机的资源)。  聪明的你会想到, 可拆装的墙板隔音效果或安全性不够(docker容器之间的隔离性比真实虚拟机要稍微弱), 会不会有坏人打个洞偷窥?  会不会有人监听我在房间的一举一动?  可拆装的墙板肯定是不比水泥墙(虚拟机隔离性)牢固.虽说隔离性没有虚拟机那么强,但是目前为止docker还没暴露出关于这方面的问题,广泛的社区以及大厂Google等公司都在使用,所以我们还是可以放心大胆使用的。   假如有一天房东要把房子卖了,只要把可拆装的墙板移除,打扫一下,回到原样,不破坏房子原样,就可以出售房子了(在容器中安装的软件,程序等都不会污染到宿主机的环境,容器被删除也就被删除了)。

原文地理:https://blog.csdn.net/xyz_dream/article/details/53081687

Guess you like

Origin www.cnblogs.com/jpfss/p/10929895.html