-
Notifications
You must be signed in to change notification settings - Fork 386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is the new LayersData field the compressed size? #1663
Comments
LayersData.Size is the compressed image size |
@ningmingxiao Thanks for the confirmation. Given the first set of commands in my original post (i.e. So the question I have, is there a way to provide the uncompressed size? Docker seems to have a way to do this, so just wondering if there's something easily done to provide that value in the results too. |
In most cases (but not reliably all the time), the MIMEType field can help determine whether the blob is compressed or uncompressed. The other size (compressed/uncompressed) is not typically available. The uncompressed size of a compressed layer can only be determined by decompressing; the compressed size of an uncompressed layer is not a well-defined number at all (it depends on compression settings). |
@mtrmac So there's no way to make any guarantees about the |
% skopeo --override-os linux inspect docker://quay.io/libpod/alpine | grep 'MIME\|Size'
"MIMEType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
"Size": 2896510,
% skopeo --override-os linux copy docker://quay.io/libpod/alpine dir:t
…
% skopeo --override-os linux inspect dir:t | grep 'MIME\|Size'
"MIMEType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
"Size": 2896510,
% skopeo --override-os linux copy --dest-decompress docker://quay.io/libpod/alpine dir:t
…
% skopeo --override-os linux inspect dir:t | grep 'MIME\|Size'
"MIMEType": "application/vnd.docker.image.rootfs.diff.tar",
"Size": 5843968, |
Tangential question... if a tool "mirrors" an image to a new destination and changes the compression type (i.e. compressed -> uncompressed OR uncompressed ->compressed), then I assume that changes the image digest too? |
Yes it does. |
I saw a recent change in this PR: #1626 and was wondering what the
LayersData.Size
field corresponds to. Is this the compressed size of the layer?For example, docker reports this for the latest redis image:
Another way to look at the image with docker:
NOTE: I think both of the above examples must be returning the size of the redis image AND its base image? Maybe?
This way seems to match value reported by skopeo:
The skopeo code that consumes this latest change reports this:
NOTE I assume these last two examples above only report the layers for the image itself?
At any rate, I have to assume
LayersData.Size
is the compressed image size, or maybe I am missing something. Perhaps @ningmingxiao can provide more insight into what the value represents.Would it be possible to report compressed and uncompressed sizes, if for no other reason than completeness / convenience?
The text was updated successfully, but these errors were encountered: