Image instance.
Image.base()
Start from the default OpenSandbox environment (Ubuntu 22.04, Python, Node.js, build tools).
Image
Builder Methods
image.apt_install(packages)
System packages to install via apt-get
Image
image.pip_install(packages)
Python packages to install via pip
Image
image.run_commands(*cmds)
Shell commands to run during build
Image
image.env(vars)
Environment variables to set
Image
image.workdir(path)
Default working directory
Image
image.add_file(remote_path, content)
Destination path in the image
File content
Image
image.add_local_file(local_path, remote_path)
Path to the local file
Destination path in the image
Image
image.add_local_dir(local_path, remote_path)
Path to the local directory
Destination path in the image
Image
Utility Methods
image.to_dict()
Returns the image manifest as a plain dict.
Returns: dict
image.cache_key()
Computes a deterministic SHA-256 hash of the manifest for cache lookups.
Returns: str