Uh oh!
There was an error while loading. Please reload this page.
Fix image size calculation to show unpacked size - #991
Conversation
Bortnyak
commented
Dec 29, 2025
Hey @dcantah, take a look at this PR please. |
theetherGit
commented
Dec 29, 2025
Bortnyak
commented
Jan 14, 2026
jglogan
commented
Jan 17, 2026
@Bortnyak I'll try to review it next week. Thanks for the reminder, and sorry for the delay! Could you rebase it PR to resolve the conflicts? |
Bortnyak
commented
Jan 19, 2026
Thanks @jglogan. |
jglogan
commented
Jan 25, 2026
@Bortnyak Sorry, still owe this a review, I haven’t forgotten |
| let created = config.created ?? "" | ||
| let size = descriptor.size + manifest.config.size + manifest.layers.reduce(0, { (l, r) in l + r.size }) | ||
| let compressedSize = descriptor.size + manifest.config.size + manifest.layers.reduce(0, { (l, r) in l + r.size }) |
There was a problem hiding this comment.
See the implementation in #862, if that moves into the image client and we merge that, you could use the same logic for the OCI image size, and then you could extend it so it instead returns a struct containing say, ociImageSize and snapshotSize.
There was a problem hiding this comment.
Thanks to both of you. I'll wait until #1098 is merged and will use that logic
There was a problem hiding this comment.
Hey @jglogan
I've added the change consolidating size retrieval into a single method that returns both ociImageSize and snapshotSize in an ImageSizeInfo struct, following your suggestion.
Check the PR, please.
jglogan
commented
Feb 5, 2026
…iImageSize and snapshotSize in an ImageSizeInfo struct Signed-off-by: Bortniak Volodymyr <Bortnyak@users.noreply.github.com>
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
saehejkang
commented
Feb 15, 2026
The |
Are these the different types of image sizes that can be outputted?
I am thinking it might be worthwhile to output both the sizes in the |
Hey @saehejkang Yup, those sizes are different: Yes, I agree that it would be useful to output both in |
| } | ||
| public func getSnapshotSize(description: ImageDescription, platform: Platform) async throws -> UInt64 { | ||
| self.log.info("ImagesService: \(#function) - description: \(description), platform: \(String(describing: platform))") |
There was a problem hiding this comment.
nit: this should be updated to follow patterns of the other log usages in this file, like here
saehejkang
commented
Apr 27, 2026
Sounds good! |
saehejkang
left a comment
There was a problem hiding this comment.
This LGTM but needs a review from @jglogan
Type of Change
Motivation and Context
#709
Previously,
container image list -vonly showed compressed blob size. Now it shows:Snapshot size (unpacked) when available
Compressed blob size as fallback when image hasn't been run yet
This better reflects actual storage usage and matches Docker's behavior of showing unpacked size.
Tests use >= comparisons because filesystems allocate space in fixed blocks (4KB on macOS), making exact byte counts unreliable.
Testing
p.s.: if this doesn't match with the maintainers' vision of how image size should be represented, feel free to close this PR :)