To Docker or to Vagrant

To Docker or to Vagrant, an eternal struggle for a dev-ops / smart people (like me!) who wants to automate stuff is a big life and death question! No seriously, I mean there are just 2 camps of people, one is hardcore docker supporters who want docker everywhere (without realizing that docker is not a full virtualization solution but uses Linux kernel’s namespaces and cgroups functionality. So what does it mean? Well for starters, anything that requires mounting operations inside the docker container, for instance, requires special privileged access and these have the possibility to change your actual host filesystem (eg: mounting filesystems inside the container will mount it indirectly on your host as well and rest is history. It is not just mount operations, simple things like socket access, changes to locale or local-gen will not work inside docker containers without passing special access privilege flags while running the docker container.

Vagrant is a straightforward configuration script for Virtual Box (VB) which is a full virtualization solution. So one basically installs an OS and does everything inside that container itself. Also, vagrant vbox files are easier to share (since it is a single file itself, unlike the layered approach in Docker). In any case, doing privileged operations in VB/Vagrant is more reassuring then doing the same on Docker. So even though I am a docker supporter, I also like vagrant because of the full virtualization support and next to impossibility to mess up with your host system.

Anyways, that’s that. So to Docker or to Vagrant is a personal choice depending on the use case one is trying to implement as well as the need for distribution (private or public). Cheers & send in your comments.