Skip to main content
A template is a reusable sandbox environment. You define a builder, run a build, and then create sandboxes from the resulting template ref.

Build Flow

  1. Select a base image, existing template, or Dockerfile.
  2. Add setup steps such as package installs, file copies, repository clones, and build commands.
  3. Configure runtime defaults such as environment variables, user, workdir, start command, and readiness probe.
  4. Build the template. Nullspace prepares the environment and stores a snapshot.
  5. Create sandboxes with Sandbox.create(template="name:tag").
builder = (
    Template()
    .from_node_image("24")
    .npm_install(["typescript"], g=True)
    .set_runtime_envs({"NODE_ENV": "production"})
)

build = Template.build(builder, name="node-agent", tags=["stable"])
Build envs only apply while the template is being built. Runtime envs are persisted into sandboxes launched from the template.

Template Refs

Template refs can be names, tags, aliases, canonical refs, or IDs depending on the operation. For launch paths, prefer stable refs such as my-template:stable.