diff --git a/usr/lib/python3.6/lxcmgr/lxcmgr.py b/usr/lib/python3.6/lxcmgr/lxcmgr.py index 2edb240..248efa2 100644 --- a/usr/lib/python3.6/lxcmgr/lxcmgr.py +++ b/usr/lib/python3.6/lxcmgr/lxcmgr.py @@ -17,8 +17,7 @@ def prepare_container(container, layers): rootfs = os.path.join(LXC_ROOT, container, 'rootfs') # Unmount rootfs in case it remained mounted for whatever reason unmount_rootfs(rootfs) - layers = layers.split(',') - mount_rootfs(container, layers, rootfs) + mount_rootfs(container, layers.split(','), rootfs) def mount_rootfs(container, layers, mountpoint): if len(layers) == 1: @@ -26,7 +25,7 @@ def mount_rootfs(container, layers, mountpoint): subprocess.run(['mount', '--bind', layers[0], mountpoint]) else: olwork = os.path.join(LXC_ROOT, container, 'olwork') - subprocess.run(['mount', '-t', 'overlay', '-o', 'upperdir={},lowerdir={},workdir={}'.format(layers[0], ':'.join(layers[1:]), olwork), 'none', mountpoint]) + subprocess.run(['mount', '-t', 'overlay', '-o', 'upperdir={},lowerdir={},workdir={}'.format(layers[-1], ':'.join(reversed(layers[:-1])), olwork), 'none', mountpoint]) def unmount_rootfs(mountpoint): if os.path.exists(mountpoint):