cpu_count, memory_mb, disk_mb, internet_access, build_backend,
build_secrets, and skip_cache are available on both Template.build() and
Template.build_in_background().
disk_mb sets the minimum rootfs size (MB) baked into the template. The build VM’s
rootfs is grown to this size before its snapshot is captured, so every sandbox created
from the template — cold create, warm-pool checkout, fork, or resume — inherits the
larger disk. Use it for workloads that need local scratch space (cloning large repos,
build artifacts). Omit it to use the default headroom.
Background Builds
CLI
--backend buildkit is optional for
Dockerfile input; --backend native is rejected for Dockerfile builds.
For BuildKit Dockerfile builds, internet_access=False maps to BuildKit’s
network-disabled mode. Private registry pulls and package installation steps
that need outbound access will fail unless their inputs are already available
from an accessible cache or local build context.
BuildKit Secrets
BuildKit Dockerfile builds can receive request-time secrets forRUN --mount=type=secret instructions through the Python SDK, CLI, or HTTP API.
Secret values are written as temporary files on the build worker, passed to
buildctl with --secret, and are not stored in build definitions, cache keys,
context manifests, logs, or status metadata. CLI dry-run/render/error output
redacts request-time secret values.
source is a client-side hint (value, env, or file); SDKs and CLIs
resolve env/file inputs before submission. Native template builds reject
build_secrets. Retries of builds that used secrets must provide fresh values
for the same secret IDs, for example nullspace template retry tb_... --build-secret-env npm_token=NPM_TOKEN.