B
What is Vagrant and Docker?In general, Docker and Vagrant are referring simply to a different degree of virtualization, Docker is a means of virtualization at Linux nucleus (not only Linux, but I don't want to say how it's going on in the mama and windows itself), Vagrant, as a complete virtualization, it's not like that's what Linux thinks.In fact, it's a little different: Docker actually provides the above-mentioned virtualization, and Vagrant is simply the manager of the virtualization funds, and the above-mentioned full-virtualization range actually belongs to the VirtualBox managed by Vagrant. Vagrant has the concept of a provider (the broker of virtualization) and Vagrant can manage both VirtualBox and Docker.Why do you have to do this?You don't point out what exactly the objectives are, so you're gonna have to write what kind of problems this solves and what problems. adopted decide on a tool.Virtualization as such has many nice bonuses, including:Simple and easy limitation of resource processesResource isolationThe ability to deliver is not an annex as such, but a complete solution that is not necessary Establish and build♪ Start.Indirect - repeatability of processesIt's very good in terms of infrastructure, because it allows us to move from the model. broken. to model broken.which is much easier to automate and save the flow of resources.In terms of development, there are two key advantages that can change the development paradigm:The collection of an application inside the virtual machine turns the situation out of my car working in this virtual car. The engineer, who should deploy the application, getting it in a virtual machine, knows that only the launch of the image is required, spends ninety-seven percent of the time the launch errors.The use of virtual machines enables the developer to fully simulate the infrastructure in which the project will be deployed, which again reduces the costs with the known problem of my car, and keeps a few versions of the software for different projects (if project A uses PHP 5.3, and project B uses PHP 7.0, instead of juggling versions in the working car, the developer can keep them in separate isolated machines).In this case, of course, the second point is interesting.And Vagrant + VirtualBox, and Docker allows it to be implemented, so there is no fundamental difference, so it makes sense simply to describe the concepts of both instruments.VirtualBox is in itself just a virtual machine manager who lets them out. It's just, it's taking the image of the system's files, emulating the processor, operating memory, hard drive, a virtual machine looking for a bottle of network on a virtual disk, and the car's starting to start like it's real.Vagrant is the manager of virtualization funds, and it can actually launch not only VirtualBox, but also Docker. Specifically in this Vagrant section, it is possible to automate a virtual machine (or virtual machines) VirtualBox from a pure operating system, using the propeller to initiate the car with shell scrupt or configuration manager.Docker himself provides exactly the same virtualization function, but very different in terms of concept. It uses the following function for its purposes:Copy-On-Write's system of layers for the file system. The final file system is collected from several layers, so the images can divide the lower layers, and each virtual machine uses its own layer (the uppers of the compound), so the machines can use a common base that cannot be copied for the start of the car.Linux nucleus (although it is difficult to say how it is organized in Mac/Windows)This allows cars to be treated as expendable and re-established hundreds of times per second (this is a very rapid process compared to a full virtual car). As a result, Docker ' s philosophy has evolved, which adopts the process-per-container rule (one on the container) and instead of the distribution of virut machines, Docker ' s concept involves the distribution of applications, each of which has a virtual isolation machine.Virtualization inside is almost the same as the conventional virtual machine: a root process that raises all others is under way. The Vagrant-VirtualBox samples usually use the usual init, Docker-like app, so it appears that the Vagrant-Virtualbox virtual machine has an OS manager monitoring everything and Docker-like is nothing but the final application.Therefore, using Docker ' s infrastructure, the key difference is that Vagrant+Virtualbox is usually used to raise one car with everything in the world, and in the case of Docker will be lifted by container for each service (redis, database, line services, etc.).Thus, Virtualbox + Vagrant and Docker are distinguished mainly by a concept that does not have a functional difference. Nevertheless, it cannot be noted that the communichi for each instrument is more developed in the direction in which the instrument itself is used: using Docker, you can use commonly available isolated machines with one process in each car and configuration through variable environments, using Vagrant, you have access to machines that are configurationd through a manager ' s configuration (chef, puppet, saltstackll) or simply,Is there a difference?In my comments on the question, I have taken the position of the no-criminal difference between them, and I intend to keep it.That the Vagrant-up-VirtualBox that Docker actually provides the same function:Virtual car with one root process (in short, so all cars work)Distributed images of these virtual machinesPossibility of a virtual car to host portsAbility of hosting directors in a virtual machineInternal virtual machine network capacityPossibilities of launch/deposition of virtual machinesPossibility of maintaining, unloading and downloading a virtual machineLimitation of a virtual resource machineSo, in fact, there's no functional difference between what you're building your infrastructure, no, you can transfer the vagrantagrant exactly to the philosophy of "one trial on the car" or put everything in the world in one docker-container. However, Docker has a number of advantages that do not affect the performance of virtualization itself, which simply make its use more convenient and cost-effective (and that have shaped its philosophy):Lack of full virtualization costsCOW-system of layers that saves space when using multiple machines with a common ancestorAlmost instantaneous launch by not initializing the system (loading the nucleus, mounting the discs and the whole incredible operating park that occurs when the machine is activated) and the container only remains to launch the binary specified for it by the entry point.Because of this life cycle of the container (in the developer ' s car) is generally much shorter than the virtual car (and, bonosom, it is possible to cancel the database with almost one team).The Docker treatment may be a little more complex, but the overhead costs of the service coupling are declining, and the end-use exports as a virtual machine may be less labour-intensive than in the case of Vagrant + VirtualBox. Nevertheless, vagrant I would not write off the accounts because until the world went to container technology in its entirety, it's closer to re-establishing a whole circle (one car with all the inside) and, in addition, no one forbids using it in the Docker connection.