Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is the difference between vagrant, docker, virtualenv or just a virtual machine?

I develop websites using python with django framework, I like to get things done fast. I used to use virtual machine or in the local host machine, recently went to vagrant, I am not sure if there is other technologies to help keep the process faster? I could use some tips and pointers.

like image 458
osama7901 Avatar asked Oct 21 '16 12:10

osama7901


People also ask

What is the difference between Docker and virtual environment?

The main difference lies in their architecture, demonstrated below. Virtual machines have host OS and the guest OS inside each VM. Guest OS can be any OS, like Linux or Windows, irrespective of host OS. In contrast, Docker containers host on a single physical server with a host OS, which shares among them.

What is difference between vagrant and Docker?

Essentially, Docker is a technology for creating and running Linux containers, and Vagrant is a machine provisioning tool used to create VMs and then populate them with applications. In other words, you use Vagrant to create a VM and install Docker.

Is a virtual environment the same as a virtual machine?

A virtual machine (VM) is a virtual environment that functions as a virtual computer system with its own CPU, memory, network interface, and storage, created on a physical hardware system (located off- or on-premises).

Should I use Docker or VENV?

While Docker provides an isolated environment for your Python application, you're better off by using virtualenv (or your tool of choice) nevertheless. It can help you to maintain control over your Python environment & dependencies.

What is the difference between Docker and Vagrant?

As we know, Docker focuses more on containers while Vagrant focused more on Virtual Machines. The container and virtual machine are generally compared on three following parameters. Read: Who Is A Devops Architect And How To Become One?

What is the difference between a virtualenv and a docker container?

A virtualenv only encapsulates Python dependencies. A Docker container encapsulates an entire OS. With a Python virtualenv, you can easily switch between Python versions and dependencies, but you're stuck with your host OS.

What is the difference between containers and Vagrant?

Containers can be whipped up in milliseconds rather than minutes, and require megabytes of RAM rather than Gigabytes. While you can use Vagrant to run multiple instances of the same virtual machine to run multiple applications, doing with containers is going to have significantly better performance.

What is the difference between a virtual machine and a container?

In the case of virtual machines, resources like CPU, memory, and I/O may not be allocated permanently to containers — unlike in the case of containers, where the resource usage with the load or traffic.


1 Answers

- Docker

  • It is great at building and sharing disk images with others through the Docker Index
  • Docker is a manager for infrastructure (today's bindings are for Linux Containers, but future bindings including KVM, Hyper-V, Xen, etc.)
  • Docker is a great image distribution model for server templates built with Configuration * Managers (like Chef, Puppet, SaltStack, etc)
  • Docker uses btrfs (a copy-on-write filesystem) to keep track of filesystem diff's which can be committed and collaborated on with other users (like git)
  • Docker has a central repository of disk images (public and private) that allow you to easily run different operating systems (Ubuntu, Centos, Fedora, even Gentoo)

- virtualenv

  • It isolates the Python interpreter and the Python dependencies on one machine so you can install multiple Python projects alongside each other with their own dependencies. But for the rest of the machine the virtualenv doesn't do anything:

  • you still have global dependencies / packages that are installed using your Mac OS X / Linux package manager and these are shared between the virtualenvs.

- A virtual machine (VM)

  • It is a software program or operating system that not only exhibits the behavior of a separate computer, but is also capable of performing tasks such as running applications and programs like a separate computer.
  • A virtual machine, usually known as a guest is created within another computing environment referred as a "host."
  • Multiple virtual machines can exist within a single host at one time.

- Vagrant

  • often used to programmatically configure virtual machines

  • specifies the whole machine: it allows you to specify the Linux distribution, packages to be installed and actions to be taken to install the project.

  • So if you want to launch a Vagrant box with multiple Python projects on that machine you'd still use virtualenv to keep the Python dependencies separate.

like image 64
mahendra kamble Avatar answered Oct 11 '22 02:10

mahendra kamble