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
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