nodus.image
View MarkdownUpload or build container images for Nodus workloads with Image.
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.
Image.push instead uploads an already-built local image immediately and returns its digest reference.
class Image(*, base: str | None = None, dockerfile: Obj | None = None, python: str | None = None, steps: tuple[tuple[Any, ...], ...] = , existing: str | None = None, project: 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, project: str | None = None) -> _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, *, project: str | None = None) -> _ImageAn Image object in the selected project, or the caller’s project when omitted.
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.push
Section titled “Image.push”push(source: str | Path, *, name: str, project: str | None = None) -> strUpload a local Docker image or single-image Docker-save archive and return its immutable reference.
Uses the same Nodus login, project authorization and OCI upload as nodus image push. The CLI is
included in platform wheels. The result can be passed directly to Sandbox.create(image=...);
uploading does not create an Image API object or require an image-pull Secret.
Image.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