
Why use Vagrant with Docker around?
Vagrant was a great way to ensure reliable software delivery process. It allowed the developers to use readily available Vagrant boxes and adjust them to create development environments mimicking the conditions in production. But Docker is really becoming mainstream nowadays, so why use Vagrant with Docker being available?
The point is, Vagrant and Docker are not analogs and cannot substitute each other.
Read more: https://itsvit.com/blog/vagrant-vs-docker-better-software-development-environments/
Vagrant is a tool from HashiCorp aimed at enabling the developers to create authentic development environments mirroring the conditions in production. It allows creating a VM with exactly the needed combination of OS, software versions, binaries, and libraries. This speeds up the bug fixing process tremendously and ensures the continuity of the process.

Docker, on the other hand, is a product from Docker, Inc. that approaches the task from a diametrically opposite angle. Instead of adapting the dev environment to the demands of the production systems, Docker containers ensure the infrastructure immutability, so the app works exactly the same in development, testing, staging and production β as long as there is the Docker virtualization layer to support the containers.

Therefore, if Docker is so much more useful, why use Docker and Vagrant instead of using Docker alone?
Vagrant was built with flexibility in mind and is intended to support the development process. Developers working with any language, on any OS, in any type of architecture and on any scale can use Vagrant boxes to emulate the behavior of their apps in ANY production environments. This is unbeatable in terms of usefulness, especially if it comes down to the current situation with your apps.
Legacy infrastructure and legacy code are rarely able to support containers without a major investment into redesign and optimization. Sometimes, this investment can require huge expenses that are either not feasible or not in the highest priority right now. Thus said, Vagrant provides a nearly free and very convenient approach to testing your app in various scenarios and fixing the bugs.
However, app containerization and digital transformation of legacy infrastructures are in full swing nowadays. Businesses large and small understand the importance and efficiency of running cloud infrastructures composed of Kubernetes clusters configured by Terraform manifests and holding pods of Docker containers with apps. It provides such a tremendous boost to operational flexibility, ease of monitoring and maintenance, that once the companies taste this approach β they never want to go back to their pre-cloud manual deployments.
Final thoughts on why use Vagrant with Docker
Thus said, there are some cases when using Vagrant with Docker provider is preferable β for example, when splitting a monolithic app into microservices. This is an endeavor that requires a combination of Vagrant and Docker in the development environment to ensure stable operations in production. On the other side, maybe going for the full-Docker environment from the very start can make the transition to microservices easier for all parties involved?