Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Could someone explain to me the difference between Docker and Vagrant ?


Vagrant manages virtual machines. Docker uses linux containers, which is essentially "chroot on steroids" [1]. A linux container is just an isolated process (from which you run your code) on the host machine, like a FreeBSD jail. The host machine can peer into the container, but the container cannot see the host machine. Docker just helps to automate and manages the linux container life-cycle.

p.s. I'm planning on doing a couple screencast episodes about linux containers and docker on my website, which should be online in the next week or so @ http://sysadmincasts.com/

[1] http://lxc.sourceforge.net/


Please post your screencasts here.


Seconded. I'm looking for as much learning material on Docker as possible.


They're actually quite similar. Docker is to lightweight containers as Vagrant is to virtual machines (more or less anyway; Vagrant lets you configure a lot more at this point). The nice thing is that the Dockerfile makes the whole thing a lot more transparent; VMs are sort of nebulous black boxes, whereas you can follow the construction of the container through the Dockerfile.

I'll be interested in seeing how the ecosystem evolves when Vagrant becomes better able to manage containers.


There is also a lot of talk about Docker and Vagrant working together. Like using Vagrant to manage Docker containers..


The typical use case is to use Vagrant to spin up the machine which then runs docker. I wouldn't recommend managing Docker containers with Vagrant unless you're really heavily invested in a pure vagrant workflow and for some reason cannot afford to call docker commands directly.


Fundamentally, Vagrant builds VirtualBox VMs, while Docker builds containers (e.g. LXC containers). Other than that, feature sets and communities are different.


And-- Vagrant has expanded a bit and now can build out a few different types of VMs, including VMWare images and AMIs for Amazon EC2.


I too, would really like to see a comparison between Docker and Vagrant with an LXC provider (https://github.com/fgrehm/vagrant-lxc).




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: