Skip to content

Estimating image size on disk when Docker is wrong#299

Merged
Dramelac merged 5 commits into
devfrom
fix/img_size
Mar 8, 2026
Merged

Estimating image size on disk when Docker is wrong#299
Dramelac merged 5 commits into
devfrom
fix/img_size

Conversation

@ShutdownRepo

Copy link
Copy Markdown
Member

An issue exists on Docker. The disk size of an image is wrong and tends to return ~16GB instead of ~40GB.
To address that we put in place a low limit that, if crossed, replaces the dynamic size (wrong) with an hardcoded estimate. We think it's better to display a rough estimate than continue to rely on Docker that returns something completely off.
We intend to open a Docker issue when we have sufficient intel to understand the behavior and reproduce steps.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a workaround in ExegolImage to display a hardcoded size estimate when Docker reports an implausibly small on-disk image size, aiming to avoid misleading output until Docker’s underlying behavior is understood/fixed.

Changes:

  • Track Docker’s raw Size (bytes) separately for sanity-checking.
  • Introduce per-tag minimum thresholds and estimated sizes (GB) and switch display to an estimate when Docker-reported size is below the minimum.
  • Emit a one-time verbose warning when the fallback display is used.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread exegol/model/ExegolImage.py Outdated
Comment thread exegol/model/ExegolImage.py Outdated
Comment thread exegol/model/ExegolImage.py Outdated
@Dramelac Dramelac changed the base branch from master to dev March 8, 2026 16:09
@Dramelac Dramelac merged commit 17883fd into dev Mar 8, 2026
34 checks passed
@Dramelac Dramelac deleted the fix/img_size branch March 8, 2026 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants