Giter Club home page Giter Club logo

vagrant-docker-compose's Introduction

Vagrant Provisioner: Docker Compose

A Vagrant provisioner for Docker Compose. Installs Docker Compose and can also bring up the containers defined by a docker-compose.yml.

Install

vagrant plugin install vagrant-docker-compose

Usage

To install docker and docker-compose

Vagrant.configure("2") do |config|
  config.vm.box = "ubuntu/trusty64"

  config.vm.provision :docker
  config.vm.provision :docker_compose
end

To install and run docker-compose on vagrant 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", run: "always"
end

Equivalent to running:

docker-compose -f [yml] up -d

To install and run docker-compose, with multiple files, on vagrant up

Vagrant.configure("2") do |config|
  config.vm.box = "ubuntu/trusty64"

  config.vm.provision :docker
  config.vm.provision :docker_compose,
    yml: [
      "/vagrant/docker-compose-base.yml",
      "/vagrant/docker-compose.yml",
      ...
    ],
    run: "always"
end

Equivalent to running:

docker-compose -f [yml-0] -f [yml-1] ... up -d

To install, rebuild and run docker-compose on vagrant 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 --force
docker-compose -f [yml] build
docker-compose -f [yml] up -d

To install, rebuild and run docker-compose with options on vagrant 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,
    options: "--x-networking", command_options: { rm: "", up: "-d --timeout 20"}, run: "always"
end

Equivalent to running:

docker-compose --x-networking -f [yml] rm
docker-compose --x-networking -f [yml] build
docker-compose --x-networking -f [yml] up -d --timeout 20

Other configs

  • yml – one or more Compose files (YAML), may be a String for a single file, or Array for multiple.
  • compose_version – defaults to 1.8.0.
  • project_name – compose will default to naming the project vagrant.
  • env – a Hash of environment variables to value that are passed to the docker-compose commands, defaults to an empty Hash.
  • executable_symlink_path – the location the executable will be symlinked to, defaults to /usr/local/bin/docker-compose.
  • executable_install_path – the location the executable will be stored, defaults to <executable_symlink_path>-<compose_version>, i.e. /usr/local/bin/docker-compose-1.5.0.
  • options - a String that's included as the first arguments when calling the docker-compose executable, you can use this to pass arbitrary options/flags to docker-compose, default to nil.
  • command_options - a Hash of docker-compose commands to options, you can use this to pass arbitrary options/flags to the docker-compose commands, defaults to: { rm: "--force", up: "-d" }.

Example

See example in the repository for a full working example.

vagrant-docker-compose's People

Contributors

leighmcculloch avatar slyden avatar fabiocorneti avatar waldyrious avatar harlannorth avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.