Docker vs Vagrant, what are the main differences?

Asked

Viewed 6,515 times

24

I recently had an outbreak of interest in the tool Docker. I am aware that Docker and Vagrant are virtualization solutions, however, with different approaches.

In my study there were some doubts regarding the Docker. According to this content http://techfree.com.br/2015/11/container-vs-maquina-virtual/, understood, that in the case of Vagrant is created a VM, in the case of Docker there is no such VM, but a container that is executed as a caged process.

Initially I imagined that we would not have a virtual hardware and not even a host OS, however, I’m wondering: but what about this image that is created with the command Docker push nome_da_imagem, wouldn’t be an OS guest? And the Docker Engine, what would be?

Note: the image created with the command listed above is not listed in the model below, so I wonder if it is a guest OS or something else. inserir a descrição da imagem aqui

Another question: Speaking of security, is it safer for the host system to have a web server running as a container or VM? I refer to the ability of a "process" to escape and compromise the host system. Initially I imagined that Docker would be more prone to this since it shares the same kernel.

1 answer

23


Vagrant

It was created with the aim of creating preconfigured Vms. The idea of creating a VM to simulate environments and share with your peers is great, but it’s a big problem to spend hours installing an operating system from scratch and then installing and configuring all the tools. Hashicorp, the organization that owns Vagrant, has devised a scheme to make this whole process more automatic and practical.

Need a VM with Oracle 12c? Search in the Atlas. Perhaps someone has already assembled this image. The Laravel, MVC framework in PHP, already adhered to Vagrant as official method.

In addition, Vagrant uses its own language to manipulate virtual machine settings, called Puppet. There is also the Packer, another tool used to replicate configuration across multiple environments. That is, one configuration is sufficient for different operating systems.

Docker

Docker was born from another very creative idea, and for her, we’re going to invoke the figure of the lovely whale that is her mascot.

The whale is the empty operating system. Each box is a segment of this operating system, which can be an application or a set of applications working together.

Why was this created? Going back to the same problem of Vagrant, where we have to replicate several times a VM. Suppose we now want to run several Vms at the same time. Why not just use a basic image of an operating system and all other processes use the same image?

That’s the whale. That’s the image of the operating system.

Each box is a resource that runs on top of the operating system, ie the whale. With this, we have some savings:

  • Disk space;
  • Execution memory;
  • Elimination of redundancies.

Speaking of security, it is safer for the host system to have a web server running as a container or VM?

Both offer a legal level of security, with restriction by door control, as a kind of a firewall between host and virtualized level.

Initially I imagined that Docker would be more prone to this since it shares the same kernel.

That’s true only for Linux. Docker, on Windows and Mac, runs another kernel to enable its containers.

Each Docker image is directed to a different operating system. For example, we have the Windows SQL Server image and another image of the same SQL Server with the Linux implementation.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.