Live data from Hacker News

Vagrant 2.0

hashicorp.com

111–120 of 120 posts

Re: Vagrant 2.0

#111

Since many people are still not too familiar with Vagrant (it doesn't seem to have the cachet of Docker for local dev environments), here are a few example Vagrant configurations that I use to build different servers for local testing/debugging: https://github.com/geerlingguy/ansible-vagrant-examples There are plenty of other great examples of Vagrant usage around the web, too, from Laravel's Homestead to (disclosure…

For Go-users wanting a quick way to get a basic Vim setup with Fatih's awesome vim-go plugin [1], you might want to checkout https://github.com/samuell/devbox-golang (Just updated to Go 1.9).

It is a little different from some other vagrant boxes in that it uses Ansible for provisioning. This means you can reasonable easy re-use the ansible roles (perhaps with some minor modifications) elsewhere too, like locally, or on some cloud image.

[1] https://github.com/fatih/vim-go

Re: Vagrant 2.0

#112

Since many people are still not too familiar with Vagrant (it doesn't seem to have the cachet of Docker for local dev environments), here are a few example Vagrant configurations that I use to build different servers for local testing/debugging: https://github.com/geerlingguy/ansible-vagrant-examples There are plenty of other great examples of Vagrant usage around the web, too, from Laravel's Homestead to (disclosure…

We use Vagrant with docker containers inside running our web apps. Vagrant functions as a disposable virtual dev environment (on Mac) to do our docker development in linux and know everyone's machines are identical when developing for production. A new dev can just download our latest vagrant repo, vagrant up and it'll provision their development environment to be exactly as it should be. It doesn't have to be one or…

[deleted]

Re: Vagrant 2.0

#113

Earlier quoted context omitted.

Vagrant lets you provision in a codified manner full-fledge VMs. This code can be pulled down by your developers to deploy a development environment on their machines. Inside of this you can choose to run containers of your apps with proper tooling built around it.

Can't you do the same thing with docker, docker compose?

If you've recently migrated your stack to a fully docker containerised setup, docker-compose can be a great replacement for an old vagrant provisioning setup, as the startup time will usually be a fraction of that needed by running vagrant up. It won't make sense for every project, but it's definitely a viable option for some.

Re: Vagrant 2.0

#114
post #69

Earlier quoted context omitted.

Also the early reliance on virtualbox was a performance issue for some build environments even once they were up. I have at least one C++ project that (for windows) takes 8x as long to build on vbox vs. a real machine.

Wow, it doesn't rely on VirtualBox anymore? I remember using it before for the development environment of an old company, and that being a small nuisance. Nowadays, Docker is really miles ahead in terms of usage in development environments. Vagrant was pretty easy to set-up and use back then, but now Docker is much, much easier.

Vagrant calls the backends "providers." It ships with 4 providers IIRC (VirtualBox, Hyper-V, VMWare, Docker), and there are plugins for dozens of others (it's so large a list because there's one provider each for pretty much every cloud service out there, even ones I've never heard of).

I think that VirtualBox and VMWare are the only two providers that work everywhere, unless docker runs on windows now.

Re: Vagrant 2.0

#115
post #45

Earlier quoted context omitted.

Docker is a fragmented mess network wise if you need to support developers on both windows and macOS. Also, docker requires hyper-v and admin privs on Windows. And you can't run VirtualBox with hyper-v active so you need to choose either of the two options. Granted, you could run Docker in virtualbox but it wouldn't be very clean.

I use Minikube with the VirtualBox driver, and it is the only way that I have been able to deal with my slightly unusual networking requirements and do local dev with Kubernetes. VirtualBox lets you forward ports from within the VM to your localhost directly, bypassing iptables and any default routes. Our network uses a "no-split-tunneling" VPN, so most of the Docker networking solutions are completely unusable for m…

> only way that I have been able to deal with my slightly unusual networking requirements

TBH they are not at all unusual. They are best-practices networking requirements.

Re: Vagrant 2.0

#116
post #96

Earlier quoted context omitted.

Vagrant with KVM/libvirt works great on Linux and doesn't stop you from using docker. VirtualBox is inconvenience on Linux, not Vagrant

The community is built on Vagrant-VB configs and images, so you don't really get the main benefit of Vagrant if you want to use it with something else than VirtualBox.

I disagree by saying that I don't think you really get the main benefit of Vagrant if you want to use it with other people's boxes.

Also, since the rise of virtio (thank goodness), you can easily make boxes that work on VB/VMware/KVM, and probably others too, and indeed, many boxes work like that.

Re: Vagrant 2.0

#117

What's the use case where I'd want to use Vagrant instead of Docker?

They're often complimentary, for example using Vagrant to spin up multiple VMs to run a Docker swarm mode cluster.

Vagrant is also great for learning about clustering technology. In minutes you can have dozens of VMs running on a single machine.

That said if you don't have specific OS requirements, then http://labs.play-with-docker.com/ works well for simulating a multitude of machines.

Both Docker and Vagrant rock for the same reason: image distribution. You don't have to know anything about building a VM or container image to be able to benefit from the tools.

Of course they both make it a breeze to manage the respective runtime environment too.

So in my mind Vagrant is to VMs what Docker is to Containers. Of course the use cases overlap, nonetheless they both are indispensable tools.

Re: Vagrant 2.0

#118
post #106

Earlier quoted context omitted.

Wow, it doesn't rely on VirtualBox anymore? I remember using it before for the development environment of an old company, and that being a small nuisance. Nowadays, Docker is really miles ahead in terms of usage in development environments. Vagrant was pretty easy to set-up and use back then, but now Docker is much, much easier.

I need to get into this Docker malarkey for dev machines. Running on Windows, how do you share files between the Docker image and the host machine? With Vagrant I use NFS.

You basically create a mount point inside the VM to a place on your host disk.

Re: Vagrant 2.0

#119

Earlier quoted context omitted.

Not my experience. Vagrant encounter 1: it would always exit immediately after barfing some garbage that messed up the line discipline. It wouldn't even print help menus. Reinstalling, 32 vs 64 bit, slightly different binary versions etc didn't seem to affect this behavior. Vagrant encounter 2: on a nearly virgin Windows box, "vagrant up" on a bog standard centos image stalled out for an entire work day. No stdout, n…

That screams badly written vagrant file to me.

Vagrant updates can wreak havoc too.

Vagrant is very bare-bones, so you need plugins, but those are ... picky.

Also, handling Linux / Windows / OSX with the same Vagrantfile results in interesting things. (Let's say you want to use NFS for Linux, so you put there an if, and you want to set up bridging for a local interface, you have to guess the interface name - or do shell and cmd.exe wizardy .)

Re: Vagrant 2.0

#120
post #106

Earlier quoted context omitted.

Wow, it doesn't rely on VirtualBox anymore? I remember using it before for the development environment of an old company, and that being a small nuisance. Nowadays, Docker is really miles ahead in terms of usage in development environments. Vagrant was pretty easy to set-up and use back then, but now Docker is much, much easier.

I need to get into this Docker malarkey for dev machines. Running on Windows, how do you share files between the Docker image and the host machine? With Vagrant I use NFS.

To expand on the other commentor, check out volumes: https://docs.docker.com/engine/admin/volumes/volumes/.
Post reply on HN