beaker-docker 0.8.1 → 0.8.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/beaker-docker/version.rb +1 -1
- data/lib/beaker/hypervisor/docker.rb +13 -0
- data/spec/beaker/hypervisor/docker_spec.rb +4 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 02eaf00011bdb77e04d6c2ba218c0d6cb2f0337f03ea9e8770bbc132e8532d78
|
4
|
+
data.tar.gz: 1df91fb159aca545ae67ece3c5b4dfc326a81ef5ee8ce307acf21ab16fa4459f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 312bf63f3ea66c8d75921c4314912b6451b2457e31452b5cf05b2edbd43c671cefc9c0157f89ea01fb1ed8bcd49769be5770c0c18c559f6ccc47df39620e7e60
|
7
|
+
data.tar.gz: e087e4e649f2e31db3425ffefa0c83532e89ae4b8c6d7fab090989a511ced8b3f71133d9e211ae15358312ff0106c82ebd050245feb3e9743fe6caa60aafda02
|
@@ -192,6 +192,8 @@ module Beaker
|
|
192
192
|
image_name = image.id
|
193
193
|
end
|
194
194
|
|
195
|
+
### BEGIN CONTAINER OPTIONS MANGLING ###
|
196
|
+
|
195
197
|
container_opts = get_container_opts(host, image_name)
|
196
198
|
if host['dockeropts'] || @options[:dockeropts]
|
197
199
|
dockeropts = host['dockeropts'] ? host['dockeropts'] : @options[:dockeropts]
|
@@ -228,8 +230,17 @@ module Beaker
|
|
228
230
|
container_opts['Env'] = host['docker_env']
|
229
231
|
end
|
230
232
|
|
233
|
+
# Fixup privileges
|
234
|
+
#
|
235
|
+
# If the user has specified CAPs, then we cannot be privileged
|
236
|
+
#
|
237
|
+
# If the user has not specified CAPs, we will default to privileged for
|
238
|
+
# compatibility with worst practice
|
231
239
|
if host['docker_cap_add']
|
232
240
|
container_opts['HostConfig']['CapAdd'] = host['docker_cap_add']
|
241
|
+
container_opts['HostConfig'].delete('Privileged')
|
242
|
+
else
|
243
|
+
container_opts['HostConfig']['Privileged'] = container_opts['HostConfig']['Privileged'].nil? ? true : container_opts['HostConfig']['Privileged']
|
233
244
|
end
|
234
245
|
|
235
246
|
if host['docker_container_name']
|
@@ -238,6 +249,8 @@ module Beaker
|
|
238
249
|
container_opts['name'] = ['beaker', host.name, SecureRandom.uuid.split('-').last].join('-')
|
239
250
|
end
|
240
251
|
|
252
|
+
### END CONTAINER OPTIONS MANGLING ###
|
253
|
+
|
241
254
|
@logger.debug("Creating container from image #{image_name}")
|
242
255
|
|
243
256
|
ok=false
|
@@ -303,6 +303,7 @@ module Beaker
|
|
303
303
|
'PortBindings' => {
|
304
304
|
'22/tcp' => [{ 'HostPort' => /\b\d{4}\b/, 'HostIp' => '0.0.0.0'}]
|
305
305
|
},
|
306
|
+
'Privileged' => true,
|
306
307
|
'PublishAllPorts' => true,
|
307
308
|
'RestartPolicy' => {
|
308
309
|
'Name' => 'always'
|
@@ -337,6 +338,7 @@ module Beaker
|
|
337
338
|
'22/tcp' => [{ 'HostPort' => /\b\d{4}\b/, 'HostIp' => '0.0.0.0'}]
|
338
339
|
},
|
339
340
|
'PublishAllPorts' => true,
|
341
|
+
'Privileged' => true,
|
340
342
|
'RestartPolicy' => {
|
341
343
|
'Name' => 'always'
|
342
344
|
}
|
@@ -367,6 +369,7 @@ module Beaker
|
|
367
369
|
'22/tcp' => [{ 'HostPort' => /\b\d{4}\b/, 'HostIp' => '0.0.0.0'}]
|
368
370
|
},
|
369
371
|
'PublishAllPorts' => true,
|
372
|
+
'Privileged' => true,
|
370
373
|
'RestartPolicy' => {
|
371
374
|
'Name' => 'always'
|
372
375
|
}
|
@@ -424,6 +427,7 @@ module Beaker
|
|
424
427
|
'22/tcp' => [{ 'HostPort' => /\b\d{4}\b/, 'HostIp' => '0.0.0.0'}]
|
425
428
|
},
|
426
429
|
'PublishAllPorts' => true,
|
430
|
+
'Privileged' => true,
|
427
431
|
'RestartPolicy' => {
|
428
432
|
'Name' => 'always'
|
429
433
|
}
|