docker.build¶
Docker image building, with context-hash skipping.
The public entry point is build_images(). It can be called from the
CLI (otto docker build) and directly from instructions/suites; both
share the exact same code path so semantics never diverge.
- otto.docker.build.image_full_tag(registry_url: str, project: str, image: DockerImage, hash_hex: str) str¶
Construct the
<project>-<image>:<hash>tag (with registry prefix when non-default).
- otto.docker.build.image_latest_tag(registry_url: str, project: str, image: DockerImage) str¶
-
async otto.docker.build.build_images(repo: Repo, parent: Host, *, image_names: Iterable[str] | None =
None, rebuild: bool =False) dict[str, tuple[Status, str]]¶ Build all (or selected) images for repo on parent.
- Parameters:¶
repo – The
Repowhose[docker]settings declare the images.parent – A docker-capable lab host. Builds happen here.
image_names – Optional filter — only build images whose
nameis in this iterable.Nonebuilds everything declared.rebuild – When
True, skip the context-hash existence check and always invokedocker build.
- Returns:¶
Mapping of image name to
(Status, message_or_tag). Status isSkippedfor images that already existed,Successfor fresh builds, and a failure status otherwise. The message is the full tag on success/skip, or the captured stderr on failure.