diff --git a/image/docker/squashed.py b/image/docker/squashed.py index ef6299009..a5f5f0c64 100644 --- a/image/docker/squashed.py +++ b/image/docker/squashed.py @@ -35,7 +35,6 @@ class SquashedDockerImageFormatter(TarImageFormatter): if created is not None: image_mtime = calendar.timegm(created.utctimetuple()) - # Docker import V1 Format (.tar): # repositories - JSON file containing a repo -> tag -> image map # {image ID folder}: @@ -86,7 +85,14 @@ class SquashedDockerImageFormatter(TarImageFormatter): # If the yielded size is more than the estimated size (which is unlikely but possible), then # raise an exception since the tar header will be wrong. if yielded_size > estimated_file_size: - message = "Expected %s bytes, found %s bytes" % (estimated_file_size, yielded_size) + leaf_image_id = parsed_manifest.leaf_layer_v1_image_id + message = "For %s/%s:%s (%s:%s): Expected %s bytes, found %s bytes" % (namespace, + repository, + tag, + parsed_manifest.digest, + leaf_image_id, + estimated_file_size, + yielded_size) raise FileEstimationException(message) # If the yielded size is less than the estimated size (which is likely), fill the rest with