What are the advantages of using Docker instead of Vagrant?

9

I already use Vagrant and have heard good things about Docker.

I'm a web application developer. What are the advantages of using Docker instead of Vagrant in a software development environment?

    
asked by anonymous 04.07.2015 / 21:41

3 answers

9

The maintenance of Development, Homologation and Production environments has a major impact on Application Lifecycle Management (ALM), due to the great complexity of the applications. To mitigate the risks in this management and maintain the high levels of quality desired by the users of the systems it is necessary that we use some of the available tools for the sectors of Information Technology that allow a high level of productivity. In this sense it is necessary to share the hardware resources using Virtual Machines or Containers.

Consider a system with 10 clients. Also consider that we have to maintain three different environments for each client (test, homologation and production) we must manage 30 environments, each with its software assets, database, test scripts, etc. It becomes impossible to use real machines because we would have a stack of 30 machines that would consume lots of resources and physical space. So we must use Virtual Machines to facilitate the management and provisioning of services. In this context comes the Vagrant tool that facilitates the creation of these virtual machines.

Creating and maintaining a virtual machine (Virtual Box or VMWare) takes a great deal of time and is sometimes complex. In addition to the fact that these virtual machines consume an immense amount of disk space and memory.

Due to the growth in demand for Virtual Machines and great difficulty in the operation of this environment the need to improve this model arose.

Mr. Solomon Hykes, founder of Docker Inc and current CTO realized that there was no need to re-create a full OS and simply reused the resources of the same OS in an independent run-time space called the Virtual Environment.

It uses native Kernel Linux functionality to facilitate the creation and management of these lightweight virtual environments.

So there came the Docker software that soon stole the scene when it comes to automating the software and hardware infrastructure.

Vagrant serves a purpose other than Docker and both complement each other.

In my view, the main advantage of Docker over Vagrant is the amount of resources used by each Virtualized environment. Docker uses far fewer features than the Vagrant-created virtual machines, saving disk space and memory in an overwhelming way.

With Docker you can create a WebServer in C or Go language by creating a fully functional container with less than 10 MBytes. I even created such a container by providing static content via HTTP with less than 6 MBytes link , you can run this type of container up to a 512 MB Raspberry Pi.

To learn more about Docker, visit link or # where there are posts on the subject.

    
04.07.2015 / 21:59
2

Docker uses the Linux container system, where there is an instance of the OS that shares the kernel with the machine OS, and Vagrant is a complete Virtual Machine.

By making an analogy, Docker are containers on a ship and Vagrant would be several ships.

Docker is an environment virtualizer and uses far fewer features than the Vagrant-created virtual machines, both on disk and in memory. Their disadvantage would be that the resources are not completely isolated because they are sharing the kernel. But for the most part this will not be a problem.

It allocates the resources of your machine with the services that you will perform on your Docker machine. Disk space is also much smaller. In it you can create really small images, based on Linux Alpine, for example, and have images with sizes of 5MB ~ 300MB.

    
22.08.2016 / 14:01
1

Vagrant is for development. Docker is not limited to that.

The great advantage of Docker is the ability to replicate the development environment in production. Automatically and immune to human error. This is not to mention resource saving to enable this parameterizable and highly scalable environment.

    
04.10.2015 / 03:57