Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Isolation in Vagrant vs. Docker

Why is Vagrant not considered an isolation, and Docker is, when Vagrant run a new OS and isolates everything in there? What is meant by isolation when one says: "if you're looking for isolation, use Docker"?

like image 994
darksky Avatar asked Jul 11 '14 15:07

darksky


People also ask

Should I use Vagrant or Docker for creating an isolated environment?

Docker is a more realistic option in most cases because of its flexibility, strong accessibility, and it's potential for all scale of projects, and even minimal resource consumption. However, for security-based projects, it's better to go with Vagrant and Virtual Machines.

Is Docker better than Vagrant?

Vagrant allows you to isolate all the necessary resources completely. However, compared to Docker, it requires more resources initially. Compared to Vagrant, Docker wins on this criterion because it spends fewer resources, and you can create Docker images faster than Vagrant virtual machines.

Which provides a better isolation Docker or VM?

Advantages of Docker Containers Docker containers are process-isolated and don't require a hardware hypervisor. This means Docker containers are much smaller and require far fewer resources than a VM.

Is VM more isolated than container?

Virtual MachineVMs provide more isolation between neighboring systems, as you're using a separate operating system from other machines in the same physical server. Whereas in containers, you're operating within one OS, and flaws can affect the entire system.


3 Answers

Isolation in the meaning "only isolation" i.e., not virtualization. When you want to run linux apps on linux, we are talking about isolation; when you want to run any app on top of any os, then we talk about virtualization.

Where did you read that Vagrant was not considered an isolation?

Actually, this statement is true as Vagrant is not a Container backend nor a VirtualMachine. It is a manager. It can manage VirtualBox, VMWare and now Docker. Depending on what your needs are, you can achieve isolation through Vagrant via VirtualBox or Docker, but Vagrant does not provide the isolation by itself.

Now that Vagrant supports Docker, you can use it if you need to; however, Docker is very simple by itself and IMHO does not require a tools like Vagrant. When you are playing with Virtual machines, on the other hand, Vagrant is very helpful.

like image 104
creack Avatar answered Oct 14 '22 22:10

creack


Vagrant is just a tool to create virtual machines (or even cloud instances and Docker containers). Vagrant itself does nothing for isolation. However, the tools it can handle (such as virtual machines or Docker) can be used for isolation (but also for many other things, isolation is just one of many aspects).

For some enlighment about the difference between Docker and VMs see How is Docker different from a normal virtual machine?

like image 42
Thomas Uhrig Avatar answered Oct 14 '22 22:10

Thomas Uhrig


Docker: separates the application from the underlying Operating System that it runs on.

Docker virtualise the Operating System for the application.

Vagrant is a virtual machine manager, so let's compare the Virtual Machines to Docker.

Virtual Machines: separates the Operating System from the underlying hardware that it runs on.

virtual machine virtualise the hardware for the operating system.
like image 27
Mahmoud Zalt Avatar answered Oct 14 '22 21:10

Mahmoud Zalt