Vagrant是一个专注于在多个操作系统中提供一致的开发环境的工具。而 Docker是容器管理,只要容器系统存在,就可以一直运行软件。
Vagrant is a tool focused on providing a consistent development environment workflow across multiple operation systems. Docker is a container management that can consistently run software as long as a containerization system exists.
通常容器比虚拟机更轻便,因此容器的启动和停止非常快。 大多数常见的开发机器没有内置的容器化系统,Docker使用安装了Linux的虚拟机来提供。
Containers are generally more lightweight than virtual machines, so starting and stopping containers is extremely fast. Most common development machines don't have a containerization system built-in, and Docker uses a virtual machine with Linux installed to provide that.
目前,Docker缺乏对某些操作系统(如BSD)的支持。 如果您的项目是部署在这些操作系统之一,则Docker将不会像Vagrant这样的工具提供相同的效果。 Vagrant将允许您在Mac或Linux上运行Windows开发环境。
Currently, Docker lacks support for certain operating systems (such as BSD). If your target deployment is one of these operating systems, Docker will not provide the same production parity as a tool like Vagrant. Vagrant will allow you to run a Windows development environment on Mac or Linux, as well.
对于微服务环境,Docker可以很有吸引力,因为您可以轻松启动单个Docker VM,并启动很多容器。 这对Docker来说是一个很好的应用。 Vagrant也可以与Docker提供商一起完成此操作。 Vagrant的主要优点是一致的工作环境,但是在许多情况下,纯Docker工作流程确实有意义。
For microservice heavy environments, Docker can be attractive because you can easily start a single Docker VM and start many containers above that very quickly. This is a good use case for Docker. Vagrant can do this as well with the Docker provider. A primary benefit for Vagrant is a consistent workflow but there are many cases where a pure-Docker workflow does make sense.
Vagrant和Docker都有一个活跃的社区,提供大量的“images”或“boxes”供您选择。
Both Vagrant and Docker have a vast library of community-contributed "images" or "boxes" to choose from.