Reputation: 1960
Do anyone know what exactly vagrant up --no-parallel
flag does? I found in the docs that I should use it whenever I am linkink two different containers within same Vagrantfile.
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.define "a" do |app|
app.vm.provider "docker" do |d|
d.name = "a"
d.image = "a"
end
end
config.vm.define "b" do |app|
app.vm.provider "docker" do |d|
d.name = "b"
d.image = "b"
d.link("a:a")
end
end
end
What should I run if I have Vagrantfile looking like this?
vagrant up a --no-parallel && vagrant up b
or
vagrant up a && vagrant up b --no-parallel
or
vagrant up --no-parallel
?
Upvotes: 2
Views: 938
Reputation: 13078
--no-parallel
option makes sense when vagrant up
is used to bring multiple machines up altogether: that is when Vagrantfile declares multiple machines and vagrant up
is either given no machine names or multiple machine names. In this case, if the provider supports this (and yes, Docker provider does indeed), Vagrant will attempt to bring all requested machines up in parallel, unless --no-parallel
is given.
So with Docker provider, when linking containers, one may use --no-paralel
when bringing multiple machines up altogether:
$ vagrant up --no-parallel
or
$ vagrant up /regex to match machine names/ --no-parallel
However, if you bring machines up one-by-one with separate commands, it will have no effect (no harm either) if --no-parallel
is specified or not. So one may simply do:
$ vagrant up a && vagrant up b
Upvotes: 3