feat(deployments): install deployed image base packages from a pinned Debian snapshot - #4558
feat(deployments): install deployed image base packages from a pinned Debian snapshot#4558myftija wants to merge 2 commits into
Conversation
apt-get against the live archive made the package layer's content depend on build time, so every project produced a near-duplicate blob that worker nodes each had to cache separately. Pinning sources to a fixed snapshot.debian.org timestamp and scrubbing apt's timestamped log and cache files makes the layer a pure function of the base image and the snapshot date, so it is byte-identical across projects. Default packages install in their own layer before user instructions and packages, which now go in a separate sorted RUN so customized projects keep sharing the default layer. TRIGGER_BUILD_SKIP_APT_SNAPSHOT=1 falls back to the live archive.
Assert the base image codename matches the pinned suite with an error naming the escape hatch, scope archive trust to the Debian keyring with signed-by, retry apt fetches, allow user pins of default packages to downgrade past the already-installed version, repair dpkg state after instructions when no user packages install, and bump the snapshot so images carry the latest ca-certificates security update. A test now fails when the pinned snapshot is over 90 days old, and the aptGet docs note that packages resolve against the pinned snapshot.
🦋 Changeset detectedLatest commit: 94243ad The changes in this PR will be included in the next version bump. This PR includes changesets to release 27 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughBuild image generation now installs base packages from pinned Debian snapshots by default. Default and user packages use separate installation layers for Bun and Node images. The build logic validates the Debian suite, configures APT retries, repairs broken dpkg state, and supports the 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Every project's image contained a near-duplicate base-packages layer:
apt-getagainst the live Debian archive bakes build-time archive state, so identical Containerfiles produced different ~30MB blobs and worker nodes cached one per project. The generated Containerfile now installs base packages from a pinned snapshot.debian.org archive and scrubs apt's timestamped files, making the layer a pure function of the base image and the pinned date: every project converges on one identical blob that nodes cache once.Verified by building on two independent cold-cache builders, which produced identical digests for every layer.
Notes
instructionsandpkgs, and user packages go in a separate sorted RUN, so customized projects still share the default layer. Instructions run with ca-certificates and git present and inherit the pinned sources.TRIGGER_BUILD_SKIP_APT_SNAPSHOT=1falls back to the live archive. Documented in the aptGet extension docs, which now also note that version pins resolve against the snapshot.image.instructionsneed the escape hatch plus their own sources; layers created by extensions' own apt-get calls remain per-project.