A Vagrant provisioner for Docker Compose. Installs Docker Compose and can also bring up the containers defined by a docker-compose.yml.
vagrant plugin install vagrant-docker-compose
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.provision :docker
config.vm.provision :docker_compose
end
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.provision :docker
config.vm.provision :docker_compose, yml: "/vagrant/docker-compose.yml", run: "always"
end
Equivalent to running:
docker-compose -f [yml] up
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.provision :docker
config.vm.provision :docker_compose, yml: "/vagrant/docker-compose.yml", rebuild: true, run: "always"
end
Equivalent to running:
docker-compose -f [yml] rm
docker-compose -f [yml] build
docker-compose -f [yml] up
See example
in the repository for a full working example.