chore(container): audit and reorganize .dockerignore (#1851) - #1858
Conversation
Update EPIC torrust#1840 progress: - Check off 'Subissues created and linked in this spec' - Add progress log: PR torrust#1855 merged; all sub-issue specs (rows 2-12) are now in develop; renamed torrust#1726 folder to match EPIC sub-issue naming convention
…1851) - Add header block documenting all intentionally INCLUDED paths (.cargo/, Cargo.toml/lock, Containerfile, console/, packages/, share/, src/, tests/, contrib/bencode/, contrib/dev-tools/su-exec/) - Reorganize entries into labeled sections: git metadata, CI/dev tooling, documentation, dev tooling, build artifacts, test data - Add missing safe exclusions: SECURITY.md, LICENSE, packages/AGENTS.md, src/AGENTS.md, /.vscode/ - Exclude contrib/dev-tools/ in full; restore su-exec/ via negation rule (! negation) since gcc stage compiles it - Build context: 4.75 MB -> 4.64 MB (-110 kB, -2.3%); contrib/dev-tools/ changes no longer trigger source-stage cache misses Update ISSUE.md: mark T1-T4 DONE, M1/M3/AC1-3/AC5-6 DONE, record baseline and post-change context measurements.
There was a problem hiding this comment.
Pull request overview
Reorganizes .dockerignore into clearly labeled sections and adds new exclusions (SECURITY.md, LICENSE, packages/AGENTS.md, src/AGENTS.md, and contrib/dev-tools/ except su-exec/), reducing build context by ~110 kB and narrowing cache-invalidation surface. Spec and EPIC docs are updated to reflect implementation status.
Changes:
- Reorganize
.dockerignoreinto labeled sections with a header documenting intentionally-included paths. - Exclude additional dev/legal/docs files; keep
contrib/dev-tools/su-exec/via re-include rule. - Update issue spec and EPIC progress logs to mark relevant tasks/ACs as DONE.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
.dockerignore |
Reorganized into sections; added new exclusions; documented intentional inclusions. |
docs/issues/open/1851-1840-workflow-performance-dockerignore-audit/ISSUE.md |
Marks T1–T5 and AC1–AC3/AC5/AC6 as DONE; records measured context size delta. |
docs/issues/open/1840-improve-pr-workflow-performance-epic/EPIC.md |
Marks "subissues created and linked" as done; appends progress log entry. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1858 +/- ##
========================================
Coverage 77.80% 77.80%
========================================
Files 380 380
Lines 28648 28648
Branches 28648 28648
========================================
Hits 22290 22290
Misses 6052 6052
Partials 306 306 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
ACK 1043b49 |
Summary
Reorganizes
.dockerignoreinto clearly labeled sections and adds several missing exclusions, reducing the Docker build context and narrowing the cache-invalidation surface.What Changed
.dockerignorereorganized into labeled sections:## Runtime config templates— share/## Documentation— docs/, README.md, SECURITY.md, LICENSE, NOTICE## Developer tooling— .github/, contrib/dev-tools/ (with!contrib/dev-tools/su-exec/negation to retain the su-exec source needed by the container build)## CI / repo metadata— .git/, target/New exclusions added:
SECURITY.md,LICENSE— legal/documentation files not needed in the imagepackages/AGENTS.md,src/AGENTS.md— AI agent instruction filescontrib/dev-tools/(entire directory, exceptsu-exec/) — benchmarks, scripts, and analysis tooling that previously slipped throughMeasured Impact
Cache invalidation surface reduced: changes inside
contrib/dev-tools/(workflow benchmarks, analysis scripts, etc.) no longer trigger a source-stage cache miss.Files Changed
.dockerignore— reorganized and extendeddocs/issues/open/1851-1840-workflow-performance-dockerignore-audit/ISSUE.md— issue specdocs/issues/open/1840-improve-pr-workflow-performance-epic/EPIC.md— EPIC progress update (subissues created/linked, PR docs(issues): draft sub-issue specs for EPIC #1840 workflow performance improvements #1855 logged)Validation
docker buildexecuted before and after; build context size measured with--progress=plainoutputdocker build --no-cacheconfirmedsu-exec/source is still present in the image (required forsu-execbinary compilation)Closes #1851