pub fn require_daemon_cmd(dockerfile: &str) -> Result<(), Error>Expand description
Rejects a Dockerfile whose image would never run the daemon: no CMD, or an
ENTRYPOINT that swallows it.
The artifact unconditionally carries the daemon as entry agentd (build_artifact),
and the deployment invariant is ENTRYPOINT [] plus CMD ["/agentd"] — see
default_dockerfile. A caller Dockerfile with no CMD runs the base’s own default
instead, and a non-empty ENTRYPOINT turns any CMD into that entrypoint’s arguments
rather than the process. Either way the daemon never starts, the build-time
ready/validate hooks go unanswered, and the image lands in CREATE_FAILED — or the
launch dies as a run-hook timeout — with nothing naming CMD, ENTRYPOINT, or the
artifact entry.
Weak-form on purpose: it does not check that the CMD names a path anything was
copied to. That would be Dockerfile interpretation rather than agreement checking, and
the two mistakes people actually make are the two refused here. The unenforceable half —
a base image that starts its own background process before bootstrap — stays with
whoever builds the image (docs/PROTOCOL.md, “Trust boundary”).