Git Product home page Git Product logo

chef-docker's Introduction

chef-docker Build Status

Description

Installs/Configures Docker. Please see COMPATIBILITY.md for more information about Docker versions that are tested and supported by cookbook versions along with LWRP features.

This cookbook was inspired by @thoward's docker-cookbook: https://github.com/thoward/docker-cookbook

Requirements

Platforms

  • Ubuntu 12.04
  • Ubuntu 12.10
  • Ubuntu 13.04

Cookbooks

Opscode Cookbooks

Third-Party Cookbooks

Attributes

These attributes are under the node['docker'] namespace.

Attribute Description Type Default
arch Architecture for docker binary (note: Docker only currently supports x86_64) String auto-detected (see attributes/default.rb)
http_proxy HTTP_PROXY environment variable String nil
install_dir Installation directory for docker binary String auto-detected (see attributes/default.rb)
install_type Installation type for docker ("binary", "package" or "source") String "package"
bind_uri The location to that docker should bind to. Something String tcp://0.0.0.0:4243 (docker default)
options Additional options to pass to docker. These could be flags like "-api-enable-cors". String nil

Binary Attributes

These attributes are under the node['docker']['binary'] namespace.

Attribute Description Type Default
url URL for downloading docker binary String auto-detected (see attributes/default.rb)

Package Attributes

These attributes are under the node['docker']['package'] namespace.

Attribute Description Type Default
distribution Distribution for docker packages String auto-detected (see attributes/default.rb)
repo_url Repository URL for docker packages String auto-detected (see attributes/default.rb)

Source Attributes

These attributes are under the node['docker']['source'] namespace.

Attribute Description Type Default
ref Repository reference for docker source String "master"
url Repository URL for docker source String "https://github.com/dotcloud/docker.git"

Recipes

  • recipe[docker] Installs/Configures Docker
  • recipe[docker::aufs] Installs/Loads AUFS Linux module
  • recipe[docker::binary] Installs Docker binary
  • recipe[docker::package] Installs Docker via package
  • recipe[docker::source] Installs Docker via source
  • recipe[docker::upstart] Installs/Starts Docker via Upstart

LWRPs

docker_container

Run a container:

docker_container "busybox" do
  command "sleep 9999"
  detach true
end

Stop a running container:

docker_container "busybox" do
  command "sleep 9999"
  action :stop
end

Start a stopped container:

docker_container "busybox" do
  command "sleep 9999"
  action :start
end

Restart a container:

docker_container "busybox" do
  command "sleep 9999"
  action :restart
end

Remove a container:

docker_container "busybox" do
  command "sleep 9999"
  action :remove
end

docker_image

Pull latest image:

docker_image "busybox"

Pull tagged image:

docker_image "bflad/test" do
  tag "not-latest"
end

Remove image:

docker_image "busybox" do
  action :remove
end

Usage

Default Installation

  • Add recipe[docker] to your node's run list

Testing and Development

Vagrant

Here's how you can quickly get testing or developing against the cookbook thanks to Vagrant and Berkshelf.

vagrant plugin install vagrant-berkshelf
vagrant plugin install vagrant-omnibus
git clone git://github.com/bflad/chef-docker.git
cd chef-docker
vagrant up BOX # BOX being ubuntu1204, ubuntu1210, or ubuntu1304

You can then SSH into the running VM using the vagrant ssh BOX command.

The VM can easily be stopped and deleted with the vagrant destroy command. Please see the official Vagrant documentation for a more in depth explanation of available commands.

Test Kitchen

Please see documentation in: TESTING.md

Contributing

Please use standard Github issues/pull requests and if possible, in combination with testing on the Vagrant boxes or Test Kitchen suite.

Contributors

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.