diff --git a/lxc-build b/lxc-build index c4c0ef3..63d2ebd 100755 --- a/lxc-build +++ b/lxc-build @@ -90,7 +90,7 @@ class LXCImage: def rebuild_config(self): if len(self.layers) == 1: - rootfs_path = layers[0] + rootfs_path = self.layers[0] else: # Multiple lower overlayfs layers are ordered from right to left (lower2:lower1:rootfs:upper) rootfs_path = 'overlay:{}:{}'.format(':'.join(self.layers[:-1][::-1], self.layers[-1])) @@ -109,7 +109,6 @@ class LXCImage: def set_name(self, name): self.name = name os.makedirs(os.path.join(LXC_ROOT, self.name), 0o755, True) - self.rebuild_config() def add_layer(self, layer): layer = os.path.join(LXC_ROOT, layer) @@ -119,7 +118,7 @@ class LXCImage: def copy_files(self, src, dst): src = os.path.join(build_dir, src) - dst = os.path.join(layers[-1], dst) + dst = os.path.join(self.layers[-1], dst) copy_tree(src, dst) def add_mount(self, src, dst):