Image instance.
Image.base()
Start from the default OpenSandbox environment (Ubuntu 22.04, Python, Node.js, build tools).
Image
Builder Methods
image.aptInstall(packages)
string[]
required
System packages to install via apt-get
Image
image.pipInstall(packages)
string[]
required
Python packages to install via pip
Image
image.runCommands(...cmds)
string[]
required
Shell commands to run during build
Image
image.env(vars)
Record<string, string>
required
Environment variables to set
Image
image.workdir(path)
string
required
Default working directory
Image
image.addFile(remotePath, content)
string
required
Destination path in the image
string
required
File content
Image
image.addLocalFile(localPath, remotePath)
string
required
Path to the local file
string
required
Destination path in the image
Image
image.addLocalDir(localPath, remotePath)
string
required
Path to the local directory
string
required
Destination path in the image
Image
image.builderMemory(mb)
Sets the RAM (MB) used during the build phase. Raise this when a build OOMs
(heavy apt/pip/npm). Defaults to 4096. Does not affect the resulting
sandbox’s memory — size that at create time via memoryMB.
number
required
Build-phase memory in MB
Image
Utility Methods
image.toJSON()
Returns the image manifest as a plain object.
Returns: ImageManifest
image.cacheKey()
Computes a deterministic SHA-256 hash of the manifest for cache lookups.
Returns: string