linecook-gem 0.6.9 → 0.6.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/linecook-gem/builder/lxc.rb +11 -9
- data/lib/linecook-gem/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ae6258ac3d3dbf0e03203631737b4c98b8889cf7
|
|
4
|
+
data.tar.gz: 9b0e1c1571e3e0ac148503e91df156e4517a0ebc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c89fd5065cd7fa3e11fc2815dadef2d22f6637ad3264d66f3a588e8ee5a16cbc210b995edde1cf63f2a252ed3e44d35ed8274f789a4116a63cace1ff4d11f152
|
|
7
|
+
data.tar.gz: 5e90c5ee82015828728efeb7184cdfb58477a762d93230f5998e7cb6bf5863f3b8f5e429e7dbb2cc96de70d4a9d964baa03af1eeb3d14745fbdd9286c051e4e3
|
|
@@ -20,8 +20,10 @@ module Linecook
|
|
|
20
20
|
@root = File.join(@home, @name, 'rootfs')
|
|
21
21
|
@tmp = tmp
|
|
22
22
|
@tmpmount = "linecook_#{name}"
|
|
23
|
-
config = { utsname: name, rootfs: @root,
|
|
24
|
-
config
|
|
23
|
+
config = { utsname: name, rootfs: @root, mount: {} }
|
|
24
|
+
config[:mount][:entry] ||= []
|
|
25
|
+
config[:mount][:entry] << '/sys/fs/cgroup sys/fs/cgroup none bind 0 0'
|
|
26
|
+
config[:mount][:entry] << "#{capture("mktemp -d --tmpdir=/#{@tmp} #{@tmpmount}XXXXXXX").strip} #{@tmp} none bind,create=dir 0 0" if @tmp
|
|
25
27
|
|
|
26
28
|
@config = Linecook::Lxc::Config.generate(config) # FIXME read link from config
|
|
27
29
|
@source_image = image || :base_image
|
|
@@ -232,7 +234,7 @@ eos
|
|
|
232
234
|
extend self
|
|
233
235
|
DEFAULT_LXC_CONFIG = {
|
|
234
236
|
include: '/usr/share/lxc/config/ubuntu.common.conf',
|
|
235
|
-
aa_profile: 'lxc-container-default-with-nesting',
|
|
237
|
+
aa_profile: 'unconfined', #'lxc-container-default-with-nesting',
|
|
236
238
|
arch: 'x86.64',
|
|
237
239
|
utsname: 'linecook',
|
|
238
240
|
rootfs: '/u/lxc/linecook/rootfs',
|
|
@@ -242,21 +244,21 @@ eos
|
|
|
242
244
|
link: 'lxcbr0'
|
|
243
245
|
},
|
|
244
246
|
mount: {
|
|
245
|
-
auto: 'cgroup',
|
|
247
|
+
auto: ['cgroup', 'proc:rw', 'sys:rw']
|
|
248
|
+
},
|
|
249
|
+
cap: {
|
|
250
|
+
drop: ''
|
|
246
251
|
},
|
|
247
252
|
cgroup: {
|
|
248
253
|
devices: {
|
|
249
|
-
allow:
|
|
250
|
-
'b 7:* rwm',
|
|
251
|
-
'c 10:237 rwm'
|
|
252
|
-
]
|
|
254
|
+
allow: 'a'
|
|
253
255
|
}
|
|
254
256
|
}
|
|
255
257
|
}.freeze
|
|
256
258
|
|
|
257
259
|
def generate(**kwargs)
|
|
258
260
|
cfg = []
|
|
259
|
-
flatten(DEFAULT_LXC_CONFIG.
|
|
261
|
+
flatten(DEFAULT_LXC_CONFIG.deep_merge(kwargs || {})).each do |k, v|
|
|
260
262
|
[v].flatten.each do |val|
|
|
261
263
|
cfg << "lxc.#{k}=#{val}"
|
|
262
264
|
end
|
data/lib/linecook-gem/version.rb
CHANGED