Expand description
The build artifact: a zip of the daemon binary and a Dockerfile.
What CreateMicrovmImage’s codeArtifact.uri points at (sandbox.py:523
build_artifact). Two entries, and both of them carry a measured constraint.
§The execute bit has to be in the zip entry
A build that copies a non-executable binary produces an image whose CMD fails, and
the failure surfaces as a run-hook timeout — which says nothing about permissions,
and sends the reader to look at the daemon’s startup path instead of at the archive.
So the agentd entry sets mode 0o755 explicitly rather than inheriting whatever the
host file had.
§The agent token is never in here (TRAP-5’s other half)
The artifact becomes a shared image snapshot: every MicroVM launched from the image
sees the same bytes. A per-VM secret in there is a per-VM secret shared with every VM.
So the token travels through runHookPayload at launch instead, and this function has
no parameter that could carry one — see crate::control::microvm. The test at the
bottom of this file scans the produced zip’s raw bytes for a token value to prove the
path stays closed, which is a byte scan rather than an API review because the leak
would be a value appearing somewhere, not a parameter being declared.
Structs§
- Base
Image - A base image: the platform ARN, the Dockerfile
FROMthat pairs with it, and whether it declares aWORKDIR.
Functions§
- artifact_
content_ hash - The sha256 of the artifact’s two inputs, as lowercase hex.
- build_
artifact - Zips
binarywithdockerfileinto the bytescodeArtifact.uriwill point at. - default_
dockerfile - A Dockerfile that makes the daemon the container
CMD. - dockerfile_
agentd_ port - The port in a Dockerfile’s last
ENV AGENTD_PORT=, orNonewhen it sets none. - dockerfile_
cmd - The value of a Dockerfile’s last
CMD, orNonewhen it sets none. - dockerfile_
entrypoint - The value of a Dockerfile’s last
ENTRYPOINT, orNonewhen it sets none. - dockerfile_
env_ u64 - The seconds in a Dockerfile’s last
ENV AGENTD_SSE_KEEPALIVE_SECS=, orNonewhen it sets none. - dockerfile_
from_ ref - The image ref in a Dockerfile’s first
FROM, orNonewhen it has none. - require_
daemon_ cmd - Rejects a Dockerfile whose image would never run the daemon: no
CMD, or anENTRYPOINTthat swallows it. - require_
keepalive_ under_ idle_ timeout - Rejects a Dockerfile whose
AGENTD_SSE_KEEPALIVE_SECSis not shorter than the client’s stream idle timeout. - require_
matching_ agentd_ port - Rejects a Dockerfile whose
AGENTD_PORTdisagrees with the port the create call sends ashooks.port. - require_
matching_ from - Rejects a Dockerfile whose
FROMis not the selected base image. - require_
workdir - Rejects working-directory inheritance when nothing declares one.