Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status

RSS

docker_compose (2) Versions 0.1.0

Installs docker_compose and provides the docker_compose_application resource.

Policyfile
Berkshelf
Knife
cookbook 'docker_compose', '= 0.1.0', :supermarket
cookbook 'docker_compose', '= 0.1.0'
knife supermarket install docker_compose
knife supermarket download docker_compose
README
Dependencies
Quality 0%

Docker Compose Cookbook

The Docker Compose Cookbook is a library cookbook that provides custom
resources for use in recipes.

Requirements

  • Working Docker installation. You might want to use the excellent docker Cookbook to provision Docker.

Usage

Place a dependency on the docker-compose cookbook in your cookbook's
metadata.rb

depends 'docker_compose', '~> 0.0'

Create a Docker Compose file
for the application you want to provision. A simple Compose file that uses the
official nginx Docker image looks like this:

version: '2'
services:
  web_server:
    image: nginx
    ports:
      - "80:80"

Then, in a recipe:

include_recipe 'docker_compose::installation'

# Provision Compose file
cookbook_file '/etc/docker-compose_nginx.yml' do
  source 'docker-compose_nginx.yml'
  owner 'root'
  group 'root'
  mode 0640
  notifies :up, 'docker_compose_application[nginx]', :delayed
end

# Provision Compose application
docker_compose_application 'nginx' do
  action :up
  compose_files [ '/etc/docker-compose_nginx.yml' ]
end

Attributes

  • node['docker_compose']['release'] - The release version of Docker Compose
    to install. Defaults to a sane, current default.

  • node['docker_compose']['command_path'] - The path under which the
    docker-compose command should be installed.
    Defaults to /usr/local/bin/docker-compose

Resources Overview

docker_compose_application

The docker_compose_application provisions a Docker application (that usually
consists of several services) using a Docker Compose file.

Example

docker_compose_application 'nginx' do
  action :up
  compose_files [ '/etc/docker-compose_nginx.yml', '/etc/docker-compose_nginx.additional.yml' ]
end

Parameters

  • project_name - A string to identify the Docker Compose application.
    Defaults to the resource name.

  • compose_files - The list of Compose files that makes up the Docker Compose
    application. The specified file names are passed to the docker-compose
    command in the order in which they appear in the list.

Actions

  • :up - Create and start containers.
    Equivalent to calling docker-compose up with the Compose files specified
    using the compose_files parameter.

  • :down - Stop and remove containers, networks, images, and volumes.
    Equivalent to calling docker-compose down with the Compose files specified
    using the compose_files parameter.

License & Authors

Collaborator Number Metric
            

0.1.0 failed this metric

Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.

Foodcritic Metric
            

0.1.0 failed this metric

FC016: LWRP does not declare a default action: /tmp/d89e471ceaef29f3090c7bf0/docker_compose/resources/application.rb:1
FC064: Ensure issues_url is set in metadata: /tmp/d89e471ceaef29f3090c7bf0/docker_compose/metadata.rb:1
FC065: Ensure source_url is set in metadata: /tmp/d89e471ceaef29f3090c7bf0/docker_compose/metadata.rb:1