kitchen-docker_cli 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6b0d097399f490533674ea2fa855615f81995df6
4
- data.tar.gz: 60cea728ef7e62c624913c930aabed2445a53d9f
3
+ metadata.gz: 542121f429ecd37ef1d476965ab303b0328d29ab
4
+ data.tar.gz: b01101c45a35091e275e93bde71c04dd101984f1
5
5
  SHA512:
6
- metadata.gz: 7dd67ba5691edebefd8c1d1c47c4fb52bec706fc280e089f065a756bef39fd152ce2348b699fb8c5efb0b5d8b5511fcf8348388780292b97b9e00d039fc94d32
7
- data.tar.gz: 8a76f858b39728ad3584695a331943e56f689c56a055429063289ec5b6c4e7944edb2063e2754af0457c7c4ce4a39e2098ada126c0dfb5277787df1a841f13ed
6
+ metadata.gz: a124b04c5e9474e78c744948542653e867fbb9f49622e666d8fa47cf3636408f6e5334dc58d058b9050b0cc66e71b2bee0f839071f6f456e73238f1679f17c9c
7
+ data.tar.gz: 1ae8f6d48a4c270e1a1ebc25ee674266b15496a724e179ad9472b34a5552854dc8d5be66721a9ed7dd210ba7e26f1c6d849d0f81e14cd12169d5277266c85b5e
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 0.5.0
2
+
3
+ * Add `memory_limit` option
4
+ * Add `cpu_shares` option
5
+
1
6
  ## 0.4.0
2
7
 
3
8
  * Pull request [#2][]: Add custom `Dockerfile` support ([@grubernaut][])
data/README.md CHANGED
@@ -183,16 +183,33 @@ Examples:
183
183
 
184
184
  ### dockerfile
185
185
 
186
- Create test image using a supplied dockerfile, instead of the default dockerfile created.
187
- For best results, please:
186
+ Create test image using a supplied dockerfile, instead of the default dockerfile created.
187
+ For best results, please:
188
188
  - Ensure Package Repositories are updated
189
- - Ensure Dockerfile installs sudo, curl and tar
189
+ - Ensure Dockerfile installs sudo, curl, and tar
190
190
  - If Ubuntu/Debian, Set DEBIAN_FRONTEND to noninteractive
191
191
 
192
192
  ```yml
193
193
  dockerfile: my/dockerfile
194
194
  ```
195
195
 
196
+ ### memory_limit
197
+
198
+ Constrain the memory available.
199
+
200
+ ```yml
201
+ memory_limit: 256m
202
+ ```
203
+
204
+ ### cpu_shares
205
+
206
+ Change the priority of CPU Time.
207
+ This option with value 0 indicates that the running container has access to all 1024 (default) CPU shares.
208
+
209
+ ```yml
210
+ cpu_shares: 512
211
+ ```
212
+
196
213
  ## <a name="development"></a> Development
197
214
 
198
215
  * Source hosted at [GitHub][repo]
@@ -128,6 +128,8 @@ module Kitchen
128
128
  cmd = "run -d"
129
129
  cmd << " --name #{config[:container_name]}" if config[:container_name]
130
130
  cmd << ' -P' if config[:publish_all]
131
+ cmd << " -m #{config[:memory_limit]}" if config[:memory_limit]
132
+ cmd << " -c #{config[:cpu_shares]}" if config[:cpu_shares]
131
133
  cmd << ' --privileged' if config[:privileged]
132
134
  Array(config[:publish]).each { |pub| cmd << " -p #{pub}" }
133
135
  Array(config[:volume]).each { |vol| cmd << " -v #{vol}" }
@@ -21,6 +21,6 @@ module Kitchen
21
21
  module Driver
22
22
 
23
23
  # Version string for DockerCli Kitchen driver
24
- DOCKER_CLI_VERSION = '0.4.0'
24
+ DOCKER_CLI_VERSION = '0.5.0'
25
25
  end
26
26
  end
@@ -238,12 +238,14 @@ describe Kitchen::Driver::DockerCli, "docker_run_command" do
238
238
  :privileged => true,
239
239
  :publish => ['80:8080', '22:2222'],
240
240
  :volume => '/dev:/dev',
241
- :link => 'mysql:db'
241
+ :link => 'mysql:db',
242
+ :memory_limit => '256m',
243
+ :cpu_shares => 512
242
244
  }
243
245
  end
244
246
 
245
247
  example do
246
- cmd = "run -d --name web -P --privileged -p 80:8080 -p 22:2222 -v /dev:/dev --link mysql:db test /bin/bash"
248
+ cmd = "run -d --name web -P -m 256m -c 512 --privileged -p 80:8080 -p 22:2222 -v /dev:/dev --link mysql:db test /bin/bash"
247
249
  expect(@docker_cli.docker_run_command('test')).to eq cmd
248
250
  end
249
251
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-docker_cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masashi Terui
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-27 00:00:00.000000000 Z
11
+ date: 2015-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-kitchen