diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b6baba5ec..c46e58ffc6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ Attribute deprecations: * container LWRP public_port attribute: use port attribute instead * container LWRP networking attribute: use net attribute instead +## 0.37.0 (unreleased) + +* Improvement [#276][]: Added support for docker options device and cap-add (thanks hvolkmer) + ## 0.36.0 * Bugfix: [#181][]: Fixed remove_link action (thanks jperville). * Bugfix: [#185][]: Fix for non idempotent run action on docker_container (thanks bplunkert). @@ -576,5 +580,22 @@ Lots of community contributions this release -- thanks! [#173]: https://github.com/bflad/chef-docker/issues/173 [#175]: https://github.com/bflad/chef-docker/issues/175 [#176]: https://github.com/bflad/chef-docker/issues/176 +[#181]: https://github.com/bflad/chef-docker/issues/181 +[#185]: https://github.com/bflad/chef-docker/issues/185 +[#188]: https://github.com/bflad/chef-docker/issues/188 +[#192]: https://github.com/bflad/chef-docker/issues/192 +[#196]: https://github.com/bflad/chef-docker/issues/196 +[#200]: https://github.com/bflad/chef-docker/issues/200 +[#202]: https://github.com/bflad/chef-docker/issues/202 +[#203]: https://github.com/bflad/chef-docker/issues/203 +[#205]: https://github.com/bflad/chef-docker/issues/205 +[#206]: https://github.com/bflad/chef-docker/issues/206 +[#217]: https://github.com/bflad/chef-docker/issues/217 +[#219]: https://github.com/bflad/chef-docker/issues/219 +[#220]: https://github.com/bflad/chef-docker/issues/220 +[#221]: https://github.com/bflad/chef-docker/issues/221 +[#223]: https://github.com/bflad/chef-docker/issues/223 +[#224]: https://github.com/bflad/chef-docker/issues/224 +[#276]: https://github.com/bflad/chef-docker/issues/276 [@jcrobak]: https://github.com/jcrobak [@wingrunr21]: https://github.com/wingrunr21 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]