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, project, image, hash_hex)

Construct the <project>-<image>:<hash> tag (with registry prefix when non-default).

Return type:

str

otto.docker.build.image_latest_tag(registry_url, project, image)
Return type:

str

async otto.docker.build.build_images(repo, parent, *, image_names=None, rebuild=False)

Build all (or selected) images for repo on parent.

Parameters:
  • repo – The Repo whose [docker] settings declare the images.

  • parent – A docker-capable lab host. Builds happen here.

  • image_names – Optional filter — only build images whose name is in this iterable. None builds everything declared.

  • rebuild – When True, skip the context-hash existence check and always invoke docker build.

Return type:

dict[str, tuple[Status, str]]

Returns:

Mapping of image name to (Status, message_or_tag). Status is Status.Skipped for images that already existed, Status.Success for fresh builds, and a failure status otherwise. The message is the full tag on success/skip, or the captured stderr on failure.