[virt-tools-list] [virt-bootstrap] [PATCH v5 01/13] DockerSoure: Keep list of tar files for image

Radostin Stoyanov rstoyanov1 at gmail.com
Fri Aug 4 14:30:37 UTC 2017


Store all tar files of container image in a list which can be used to
create qcow2 image with backing chains (using the tar-in function from
libguestfs).
---
 src/virtBootstrap/sources/docker_source.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/virtBootstrap/sources/docker_source.py b/src/virtBootstrap/sources/docker_source.py
index 54d8903..63865d8 100644
--- a/src/virtBootstrap/sources/docker_source.py
+++ b/src/virtBootstrap/sources/docker_source.py
@@ -65,6 +65,7 @@ class DockerSource(object):
         self.images_dir = utils.get_image_dir(self.no_cache)
         self.manifest = None
         self.layers = []
+        self.tar_files = []
 
         if self.username and not self.password:
             self.password = getpass.getpass()
@@ -96,6 +97,7 @@ class DockerSource(object):
 
             sum_type, layer_sum = layer_digest.split(':')
             file_path = os.path.join(self.images_dir, layer_sum + '.tar')
+            self.tar_files.append(file_path)
             self.layers.append([sum_type, layer_sum, file_path, layer_size])
 
     def gen_valid_uri(self, uri):
-- 
2.13.4




More information about the virt-tools-list mailing list