Skip to content

Reconfigure debconf for Docker#1412

Merged
tcely merged 3 commits intomainfrom
tcely-docker
Mar 31, 2026
Merged

Reconfigure debconf for Docker#1412
tcely merged 3 commits intomainfrom
tcely-docker

Conversation

@tcely
Copy link
Copy Markdown
Collaborator

@tcely tcely commented Mar 2, 2026

Clean up the major dive finding by treating the image file as a read-only component of the database.

@tcely tcely self-assigned this Mar 2, 2026
@tcely tcely moved this to Todo in Status Mar 2, 2026
@tcely tcely marked this pull request as ready for review March 25, 2026 02:11
@tcely tcely moved this from Todo to Ready in Status Mar 25, 2026
@tcely tcely requested a review from meeb March 25, 2026 02:11
@meeb
Copy link
Copy Markdown
Owner

meeb commented Mar 26, 2026

Can you clarify what this actually does? Why is it particularly matter if the Debconf templates are write-able at container build time?

@tcely
Copy link
Copy Markdown
Collaborator Author

tcely commented Mar 26, 2026

Can you clarify what this actually does?

Sure.

Why is it particularly matter if the Debconf templates are write-able at container build time?

Analyzing image...
  efficiency: 99.2192 %
  wastedBytes: 6650427 bytes (6.7 MB)
  userWastedPercent: 1.0326 %
Inefficient Files:
Count  Wasted Space  File Path
    5        4.1 MB  /var/cache/debconf/templates.dat
    2        742 kB  /var/cache/debconf/templates.dat-old

If you look at the current dive analysis above, you can see that the flat file database is present in multiple layers and occupies the top spot for wasted space.

By treating the file in the image as read-only we can eliminate this churn of a single file every time debconf updates a template.

Instead of overwriting the file multiple times, individual files per package are created for the new content.

This keeps the layers clean and removes the wasted space from old versions of the flat file database.

@meeb
Copy link
Copy Markdown
Owner

meeb commented Mar 26, 2026

Ah, thanks. How much space does this save? If it's obvious in the analysis I'll check it myself in a bit.

@tcely
Copy link
Copy Markdown
Collaborator Author

tcely commented Mar 26, 2026

Ah, thanks. How much space does this save? If it's obvious in the analysis I'll check it myself in a bit.

It's not a lot. Fixing this was simply on my to-do list.

I have added the dive analysis lines to my earlier comment.

Copy link
Copy Markdown
Owner

@meeb meeb left a comment

Choose a reason for hiding this comment

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

Sure why not. The big Perl script is a bit overkill but sure.

@tcely tcely merged commit b30d792 into main Mar 31, 2026
6 checks passed
@tcely tcely deleted the tcely-docker branch March 31, 2026 13:05
@github-project-automation github-project-automation bot moved this from Ready to Done in Status Mar 31, 2026
@tcely
Copy link
Copy Markdown
Collaborator Author

tcely commented Mar 31, 2026

The big Perl script is a bit overkill but sure.

It is. The nice thing about it, is that I can continue to use that on any Debian images, without requiring multiple steps to ensure that patch is available.

For this case, it was important to not use debconf, even indirectly, before the configuration was changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants