minor fixes
This commit is contained in:
parent
1608b7a93f
commit
d21b09d547
@ -13,7 +13,7 @@ lxc.uts.name = {image}
|
|||||||
lxc.net.0.type = veth
|
lxc.net.0.type = veth
|
||||||
lxc.net.0.link = lxcbr0
|
lxc.net.0.link = lxcbr0
|
||||||
lxc.net.0.flags = up
|
lxc.net.0.flags = up
|
||||||
lxc.net.0.ipv4.address = 172.17.0.2/16
|
lxc.net.0.ipv4.address = 172.17.0.254/16
|
||||||
lxc.net.0.ipv4.gateway = auto
|
lxc.net.0.ipv4.gateway = auto
|
||||||
|
|
||||||
# Volumes
|
# Volumes
|
||||||
@ -42,7 +42,7 @@ layers = []
|
|||||||
mounts = []
|
mounts = []
|
||||||
uid = 0
|
uid = 0
|
||||||
gid = 0
|
gid = 0
|
||||||
cmd = '/bin/sh'
|
cmd = '/bin/true'
|
||||||
script = []
|
script = []
|
||||||
in_script = False
|
in_script = False
|
||||||
|
|
||||||
@ -83,7 +83,7 @@ def run_script():
|
|||||||
with open(script_filename, 'w') as fd:
|
with open(script_filename, 'w') as fd:
|
||||||
fd.write(' && '.join([s for s in script]))
|
fd.write(' && '.join([s for s in script]))
|
||||||
os.chmod(script_filename, 0o700)
|
os.chmod(script_filename, 0o700)
|
||||||
subprocess.run(['lxc-execute', '-n', image, '--', '/bin/sh', '-lvc', '/run.sh'], check=True)
|
subprocess.run(['lxc-execute', '-n', image, '--', '/bin/sh', '-lc', '/run.sh'], check=True)
|
||||||
os.unlink(script_filename)
|
os.unlink(script_filename)
|
||||||
|
|
||||||
def copy_files(src, dst):
|
def copy_files(src, dst):
|
||||||
@ -92,7 +92,7 @@ def copy_files(src, dst):
|
|||||||
shutil.copytree(src, dst)
|
shutil.copytree(src, dst)
|
||||||
|
|
||||||
with open(lxcfile, 'r') as fd:
|
with open(lxcfile, 'r') as fd:
|
||||||
recipe = fd.readlines()
|
recipe = fd.read().splitlines()
|
||||||
|
|
||||||
for line in recipe:
|
for line in recipe:
|
||||||
if line == 'RUN':
|
if line == 'RUN':
|
||||||
|
Loading…
Reference in New Issue
Block a user