Commit 7683ffb
fix: Restore Dockerfile build performance regressed by tar block factor
PR #1684 lowered the SharpZipLib block factor to 1 to drop the trailing
record padding that races Podman's archive reader, causing a broken pipe
(HTTP 500) on resource mappings (#1683). It applied this to both archive
paths, but the on-disk Dockerfile build context is written to a
FileStream, where a 512 B record forces a write and flush per block and
regresses image builds by up to 10x (worst on .NET Framework).
Only the in-memory archive streamed to the daemon (resource mappings)
needs the padding gone, and a MemoryStream pays almost nothing for the
small record size (~1.3x, benchmarked). So keep block factor 1 there and
revert the Dockerfile build context to SharpZipLib's default block
factor. Document the asymmetry so it is not "consistency-fixed" back into
a regression, and add a test asserting the streamed archive carries no
padding beyond the two end-of-archive blocks.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent d6cf08d commit 7683ffb
3 files changed
Lines changed: 33 additions & 1 deletion
File tree
- src/Testcontainers
- Images
- tests/Testcontainers.Platform.Linux.Tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
195 | | - | |
| 195 | + | |
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
12 | 19 | | |
13 | 20 | | |
14 | 21 | | |
Lines changed: 25 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
62 | 87 | | |
63 | 88 | | |
64 | 89 | | |
| |||
0 commit comments