From 9f924aa57ae6365de64e1ea6aab643b4054dee25 Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Sun, 30 Mar 2014 20:47:40 -0400 Subject: [PATCH] Add --label for docker run, closes #105 --- CHANGELOG.md | 2 ++ README.md | 1 + providers/container.rb | 1 + resources/container.rb | 1 + 4 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 03b747303b..f60e4d811a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ This release deprecates AUFS/device-mapper handling from chef-docker, but provid * Enhancement: [#88][]: Migrate AUFS logic to separate cookbook * Enhancement: [#90][]: Migrate device-mapper logic to separate cookbook * Enhancement: [#110][]: Add docker Upstart pre-start script and limits configuration +* Enhancement: [#105][]: Add --label for docker run * Enhancement: [#108][]: Add --dns-search for docker run * Enhancement: [#104][]: Add TMPDIR * Enhancement: container_dns* attributes to set --dns and --dns-search for all containers @@ -413,6 +414,7 @@ Lots of community contributions this release -- thanks! [#101]: https://github.com/bflad/chef-docker/issues/101 [#103]: https://github.com/bflad/chef-docker/issues/103 [#104]: https://github.com/bflad/chef-docker/issues/104 +[#105]: https://github.com/bflad/chef-docker/issues/105 [#108]: https://github.com/bflad/chef-docker/issues/108 [#109]: https://github.com/bflad/chef-docker/issues/109 [#110]: https://github.com/bflad/chef-docker/issues/110 diff --git a/README.md b/README.md index 36b5623416..1a46199b8a 100644 --- a/README.md +++ b/README.md @@ -375,6 +375,7 @@ image | Image for container | String | LWRP name init_type | Init type for container service handling | FalseClass, String | `node['docker']['container_init_type']` init_template | Template to use for init configuration | String | nil link | Add link to another container | String, Array | nil +label | Options to pass to underlying labeling system | String | nil lxc_conf | Custom LXC options | String, Array | nil memory | Set memory limit for container | Fixnum | nil port | Map network port(s) to the container | Fixnum (*DEPRECATED*), String, Array | nil diff --git a/providers/container.rb b/providers/container.rb index 60f61a167c..7134ff93f1 100644 --- a/providers/container.rb +++ b/providers/container.rb @@ -284,6 +284,7 @@ def run 'expose' => Array(new_resource.expose), 'hostname' => new_resource.hostname, 'interactive' => new_resource.stdin, + 'label' => new_resource.label, 'link' => Array(new_resource.link), 'lxc-conf' => Array(new_resource.lxc_conf), 'memory' => new_resource.memory, diff --git a/resources/container.rb b/resources/container.rb index dc8be7aa11..acb0597222 100644 --- a/resources/container.rb +++ b/resources/container.rb @@ -26,6 +26,7 @@ attribute :init_type, :kind_of => [FalseClass, String], :default => node['docker']['container_init_type'] attribute :init_template, :kind_of => [String] attribute :link, :kind_of => [String, Array] +attribute :label, :kind_of => [String] attribute :lxc_conf, :kind_of => [String, Array] attribute :memory, :kind_of => [Fixnum] attribute :message, :kind_of => [String]