Home  >  Q&A  >  body text

单纯的开发环境来说 Docker 和 Vagrant 该如何选择?

场景一:单一开发环境

只进行单一语言的开发,启动一台虚拟机,这种情况 docker 占用的资源会不会比较多?

场景二:多环境开发

既要进行 php 开发,又要进行 python,两个程序需要不同的环境,vagrant 进行开发的话,需要启动两个 vagrant 虚拟机才行,占用资源多,这时候选择 Docker 会不会更好?

PHP中文网PHP中文网2761 days ago642

reply all(1)I'll reply

  • 高洛峰

    高洛峰2017-04-21 10:57:56

    Docker is not a virtual machine, it is process isolation and consumes very little resources.
    Vagrant is an encapsulation on the virtual machine, and the virtual machine itself consumes resources.

    If you are originally using Linux, if it is scenario one or two, choose Docker

    If you are using OSX or Windows, you need to open a virtual machine. In the first scenario, vagrant is easier. In the second scenario, you need to install Docker in vagrant

    reply
    0
  • Cancelreply