nodus.image
View MarkdownThe Modal-shaped Image builder (resources.md §5.3).
A chain of immutable builder calls describes an Image spec. Nothing touches the network until the image is used
by a published App or .build() is called; the Image object is named by the hash of its spec, so an identical
chain reuses the built digest.
class Image(*, base: str | None = None, dockerfile: Obj | None = None, python: str | None = None, steps: tuple[tuple[Any, ...], ...] = , existing: str | None = None, pull_secrets: tuple[str, ...] = ) -> NoneImage.add_local_dir
Section titled “Image.add_local_dir”add_local_dir(local_path: str | Path, remote_path: str) -> _ImageImage.add_local_file
Section titled “Image.add_local_file”add_local_file(local_path: str | Path, remote_path: str) -> _ImageImage.add_local_python_source
Section titled “Image.add_local_python_source”add_local_python_source(*modules: str) -> _ImageCopy importable local modules or packages to /workspace/<name>, where the worker imports from.
Image.apt_install
Section titled “Image.apt_install”apt_install(*packages: str) -> _ImageImage.build
Section titled “Image.build”build(*, show_logs: bool = True) -> _ImageBuild now (otherwise the first use builds it), streaming the build log; raises ImageBuildFailed.
Image.debian_slim
Section titled “Image.debian_slim”debian_slim(python_version: str | None = None) -> _ImageThe catalog nodus/python:<version> image; defaults to the caller’s Python minor version.
Image.digest
Section titled “Image.digest”Type: str | None
The built digest, known after .build() or after an App that uses the image was published.
Image.env
Section titled “Image.env”env(values: dict[str, str]) -> _ImageImage.from_dockerfile
Section titled “Image.from_dockerfile”from_dockerfile(path: str | Path, context: str | Path = '.') -> _ImageImage.from_name
Section titled “Image.from_name”from_name(name: str) -> _ImageAn Image object that already exists in the project.
Image.from_registry
Section titled “Image.from_registry”from_registry(ref: str, secret: Any = None) -> _ImageStart from an OCI reference or a catalog image (nodus/pytorch:2.8-cuda12.8).
Image.name
Section titled “Image.name”Type: str | None
Image.pip_install
Section titled “Image.pip_install”pip_install(*packages: str, index_url: str | None = None, extra_index_urls: list[str] | None = None) -> _ImageImage.python
Section titled “Image.python”Type: str | None
Image.run_commands
Section titled “Image.run_commands”run_commands(*commands: str) -> _ImageImage.uv_pip_install
Section titled “Image.uv_pip_install”uv_pip_install(*packages: str, index_url: str | None = None, extra_index_urls: list[str] | None = None) -> _ImageImage.uv_sync
Section titled “Image.uv_sync”uv_sync(project_dir: str | Path = '.', frozen: bool = True) -> _ImageImage.workdir
Section titled “Image.workdir”workdir(path: str) -> _Image