From 2762d815643754bc4f5b4a922989fc1acf5ea5b6 Mon Sep 17 00:00:00 2001 From: Radostin Stoyanov Date: Fri, 21 Jul 2017 13:13:19 +0100 Subject: DockerSource: Add support for Manifest version 1 Handle differences between version 1 and 2 of the Manifest file for Docker registry. Layers' blob sums in v1 are stored in a list "fsLayers" and the digest is stored in following filed with name "blobSum". [1] In v2 the layer list is stored in field with name "layers" and ordered starting from the base image (opposite order of v1). The digest is stored under a following field with name "digest". The size in bytes is included in a field with name "size". [2] [1] https://docs.docker.com/registry/spec/manifest-v2-1/#manifest-field-descriptions [2] https://docs.docker.com/registry/spec/manifest-v2-2/#image-manifest-field-descriptions --- src/virtBootstrap/utils.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/virtBootstrap/utils.py') diff --git a/src/virtBootstrap/utils.py b/src/virtBootstrap/utils.py index daabd26..a65d3f5 100644 --- a/src/virtBootstrap/utils.py +++ b/src/virtBootstrap/utils.py @@ -138,8 +138,11 @@ def log_layer_extract(layer, current, total, progress): Create log message on layer extract. """ sum_type, sum_value, layer_file, layer_size = layer - progress("Extracting layer (%s/%s) with size: %s" - % (current, total, bytes_to_size(layer_size)), logger=logger) + msg = 'Extracting layer (%s/%s)' % (current, total) + + if layer_size: + msg += " with size: %s" % bytes_to_size(layer_size) + progress(msg, logger=logger) logger.debug('Untar layer: (%s:%s) %s', sum_type, sum_value, layer_file) -- cgit