From f9929accff3973150f6f3957d73889e28703febf Mon Sep 17 00:00:00 2001 From: Hendrik Volkmer Date: Wed, 11 Mar 2015 13:33:17 +0100 Subject: [PATCH] Added support for docker options device and cap-add --- README.md | 2 ++ providers/container.rb | 2 ++ resources/container.rb | 2 ++ 3 files changed, 6 insertions(+) diff --git a/README.md b/README.md index 9f8f1b99ab..3bbe758f8c 100644 --- a/README.md +++ b/README.md @@ -497,11 +497,13 @@ Attribute | Description | Type | Default ----------|-------------|------|-------- additional_host | Add a custom host-to-IP mapping (host:ip) | String, Array | nil attach | Attach container's stdout/stderr and forward all signals to the process | TrueClass, FalseClass | nil +cap_add | Capabilities to add to container | String, Array | nil cidfile | File to store container ID | String | nil container_name | Name for container/service | String | nil cookbook | Cookbook to grab any templates | String | docker cpu_shares | CPU shares for container | Fixnum | nil detach | Detach from container when starting | TrueClass, FalseClass | nil +device | Device(s) to pass through to container | String, Array | nil dns | DNS servers for container | String, Array | nil dns_search | DNS search domains for container | String, Array | nil entrypoint | Overwrite the default entrypoint set by the image | String | nil diff --git a/providers/container.rb b/providers/container.rb index 861546032f..9f8e12ea30 100644 --- a/providers/container.rb +++ b/providers/container.rb @@ -362,9 +362,11 @@ def run def run_cli_args { 'add-host' => Array(new_resource.additional_host), + 'cap-add' => Array(new_resource.cap_add), 'cpu-shares' => new_resource.cpu_shares, 'cidfile' => new_resource.cidfile, 'detach' => new_resource.detach, + 'device' => Array(new_resource.device), 'dns' => Array(new_resource.dns), 'dns-search' => Array(new_resource.dns_search), 'env' => Array(new_resource.env), diff --git a/resources/container.rb b/resources/container.rb index 2757b3e0c8..45c06406c3 100644 --- a/resources/container.rb +++ b/resources/container.rb @@ -14,8 +14,10 @@ attribute :cookbook, :kind_of => [String], :default => 'docker' attribute :created, :kind_of => [String] attribute :cpu_shares, :kind_of => [Fixnum] +attribute :cap_add, :kind_of => [String, Array] attribute :destination, :kind_of => [String] attribute :detach, :kind_of => [TrueClass, FalseClass] +attribute :device, :kind_of => [String, Array] attribute :dns, :kind_of => [String, Array] attribute :dns_search, :kind_of => [String, Array] attribute :entrypoint, :kind_of => [String]