So this weekend I installed both Vagrant and Docker on my laptop and played around with them a little bit. I totally understand that they are different beasts with different intentions in mind. But I can't help to think: how could they be used to complement each other?
If you Google "Docker vs Vagrant" you'll get an ocean of blogs and articles stating how these two technologies are different. But I have yet to come across a single concrete article demonstrating how these two technologies can be used with each other. I assume there has to be specific scenarios where one would use both, otherwise there would be no reason to have the Vagrant-Docker provisioner.
So I ask: Can someone please provide me with a concrete scenario(s) in which a dev would use both Docker and Vagrant? Perhaps using Vagrant to manage a local VM and then perhaps Docker for "converting" that configured (with deployed application in tow) VM to a container, or something thereabouts?
I'm looking for specific, fairly detailed scenarios here! Thanks in advance!
This question is very broad but for dev environments you can use as your creativity spans.
So one scenario that I can think of is that you are running say Ubuntu in your production environment with Docker containers. Say your developers have Mac OS X machines running VirtualBox, but you want want their environment to be as close as possible to the production environment. So use Vagrant with Ubuntu VM and in that VM run Docker containers.
The same can be said about Windows machines, what if your production environment is all Ubuntu with Docker. You can emulated with Vagrant and VirtualBox too.
Often considered two alternative tools, Docker and Vagrant can be used together to build isolated and repeatable development environments. We will prove it setting up a Docker container for development of a Java application and taking advantage of Vagrant powerful features to solve some real life practical issues.
https://blog.zenika.com/2014/10/07/setting-up-a-development-environment-using-docker-and-vagrant/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With