Open darkn3rd opened 8 years ago
One workaround is to: vagrant destroy --force && vagrant up
Another workaround.
$dockerhelper = <<DOCKERHELPER
docker ps -q | xargs -r docker kill
docker ps -aq | xargs -r docker rm
DOCKERHELPER
Vagrant.configure(2) do |config|
...
# making vagrant idempotent again
config.vm.provision "shell", inline: $dockerhelper
# docker stuff
config.vm.provision "docker" do |docker|
...
end
end
vagrant destroy --force does not clean things, if the previous vagrant up has not finished succesfully
Summary
The Docker Provisioner should be idempotent. If you do
docker.run
twice, you get a failure.Vagrant version
Host operating system
Guest operating system
Vagrantfile
Expected behavior
Actual behavior
Steps to reproduce
vagrant up
vagrant provision
Debug
vagrant up
: https://gist.github.com/darkn3rd/2f5cb1538fae6464ff2247914c25fe0cvagrant provision
: https://gist.github.com/darkn3rd/ede1d95eac949b8bb5fcd3583e7bc8ad