Skip to content

Latest commit

 

History

History
68 lines (52 loc) · 2.85 KB

ADR004.md

File metadata and controls

68 lines (52 loc) · 2.85 KB

ADR004: Flat payload assembly

Status

Superseded by ADR006.

Context

The original Containerfile represented variants as an inheritance graph. That made a target's contents difficult to infer and coupled expensive language toolchains to changes in the shared core-components layer.

Node.js/npm and lightweight Python are different: they are intentionally universal capabilities in this repository and change far less often than the list of general OS utilities.

Decision

The Containerfile uses four roles:

  1. base-dev-tools installs Node.js 24/npm and Python 3.14/pip.
  2. runtime extends that stable floor with core OS components and common userland files.
  3. Independent payload stages build agents and language/framework tools as siblings of runtime.
  4. Every published target starts with FROM runtime AS <target> and copies in its selected payloads.

Published targets never inherit from one another. Payload stages expose files, not image configuration; the final target owns metadata such as PATH, PYTHONPATH, GOROOT, and CARGO_HOME.

Specialized Python packages, including psycopg2, do not belong in the universal runtime.

BuildKit cache mounts use their default shared mode when the underlying tool supports concurrent access. This includes npm, pip, Cargo, and Go caches. The microdnf cache remains sharing=locked because its mutable package metadata requires exclusive access. Reusing a cache ID across sibling payload stages is intentional: the shared cache avoids repeated downloads without serializing the stages at the BuildKit level.

Builder storage

The current builder host has roughly 700 GB of RAM, a 10 Gbit/s network path, and is expected to remain online indefinitely. Under that operational assumption, a tmpfs-backed BuildKit data root is a credible future optimization: both layer cache and cache-mount contents could remain memory-resident for the lifetime of the builder.

This is not yet a decision. Benchmark the complete BuildKit data root rather than isolated package-cache directories. Any experiment must also account for memory pressure and for a cold cache after the builder daemon, secure container, or host is restarted or recreated.

Consequences

  • Editing the core-components list does not reinstall Node/Python or rebuild Rust, Go, npm tools, uv/ty/ruff, or agent binaries.
  • Changing one ingredient rebuilds that ingredient and cheap final assembly, rather than descendants in an image lineage.
  • Target contents can be read as an ingredient list in the final Containerfile section.
  • Some build-only setup is repeated or factored into small helper stages. This is intentional: cache isolation and a predictable final model are more valuable than minimizing the number of stage declarations.
  • Packages needed only to build an ingredient remain in its builder and are not copied into the runtime image.