Firecracker agent image build ships an empty context — Dockerfile COPY of pinned inputs fails #538
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Agent images (codex/claude/pi) are built with
buildahinside the infra VM.image_builder._build_in_infra()creates an empty{ctx}/ctxand ships only the Dockerfile — relying on the invariant (documented on_dockerfile_hash) that agent Dockerfiles COPY nothing from the build context.The "pin & verify image inputs" work broke that invariant:
bot_bottle/contrib/codex/Dockerfile→COPY bot_bottle/contrib/codex/codex-package_SHA256SUMSbot_bottle/contrib/claude/Dockerfile→COPY bot_bottle/contrib/claude/package.json package-lock.jsonbot_bottle/contrib/pi/Dockerfile→COPY bot_bottle/contrib/pi/package.json package-lock.jsonSince nothing populates
{ctx}/ctx, any fresh agent image build now fails:Existing agents only keep working because their rootfs is cached from before the COPY was added; a cache miss (Dockerfile change, new agent) reproduces it. Repro:
BOT_BOTTLE_INFRA_BUILD=local ./cli.py startwith a codex bottle.Fix
Parse each Dockerfile's context
COPYsources, tar those committed files from the build root into the VM-side{ctx}/ctx(preserving relative paths), and fold their content into the rootfs cache digest so a repinned input rebuilds instead of reusing stale bytes.COPY --from=<stage>and absolute/traversing sources are excluded.Scope: firecracker
image_builder.pyonly; independent of the packaged-infra-artifacts work (#537), which does not touch the agent-image build path.