@@ -11,7 +11,14 @@ def setup():
11
11
if args .kvm :
12
12
programs += ['python-vm-builder' , 'qemu-kvm' , 'qemu-utils' ]
13
13
elif args .docker :
14
- programs += ['docker.io' ]
14
+ dockers = ['docker.io' , 'docker-ce' ]
15
+ for i in dockers :
16
+ return_code = subprocess .call (['sudo' , 'apt-get' , 'install' , '-qq' , i ])
17
+ if return_code == 0 :
18
+ break
19
+ if return_code != 0 :
20
+ print ('Cannot find any way to install docker' , file = sys .stderr )
21
+ exit (1 )
15
22
else :
16
23
programs += ['lxc' , 'debootstrap' ]
17
24
subprocess .check_call (['sudo' , 'apt-get' , 'install' , '-qq' ] + programs )
@@ -31,6 +38,10 @@ def setup():
31
38
make_image_prog += ['--lxc' ]
32
39
subprocess .check_call (make_image_prog )
33
40
os .chdir (workdir )
41
+ if args .is_bionic and not args .kvm and not args .docker :
42
+ subprocess .check_call (['sudo' , 'sed' , '-i' , 's/lxcbr0/br0/' , '/etc/default/lxc-net' ])
43
+ print ('Reboot is required' )
44
+ exit (0 )
34
45
35
46
def build ():
36
47
global args , workdir
@@ -147,6 +158,8 @@ def main():
147
158
args .windows = 'w' in args .os
148
159
args .macos = 'm' in args .os
149
160
161
+ args .is_bionic = b'bionic' in subprocess .check_output (['lsb_release' , '-cs' ])
162
+
150
163
if args .buildsign :
151
164
args .build = True
152
165
args .sign = True
@@ -161,6 +174,10 @@ def main():
161
174
os .environ ['USE_DOCKER' ] = '1'
162
175
elif not args .kvm :
163
176
os .environ ['USE_LXC' ] = '1'
177
+ if not 'GITIAN_HOST_IP' in os .environ .keys ():
178
+ os .environ ['GITIAN_HOST_IP' ] = '10.0.3.1'
179
+ if not 'LXC_GUEST_IP' in os .environ .keys ():
180
+ os .environ ['LXC_GUEST_IP' ] = '10.0.3.5'
164
181
165
182
# Disable for MacOS if no SDK found
166
183
if args .macos and not os .path .isfile ('gitian-builder/inputs/MacOSX10.11.sdk.tar.gz' ):
0 commit comments