Skip to main content
Pick a template by what the runtime should already contain. base-small is the default. Use browser-small to drive a browser, and desktop-small to see and control the screen. Use claude or codex when that coding CLI should already be installed. Build a template when packages or files must be in the image before the runtime boots. To save a runtime that is already running, use a snapshot.

Start from a template

Pass template="claude" or --template claude (and the same for codex) to start from an agent template. More create options are on Create a runtime.

Build a template

Build from a public Docker image (from_image) plus build steps, or from a Dockerfile string. build_and_wait blocks until the template is ready. Raise the timeout for a large image.
Use a Debian or Ubuntu image such as python:3.12-slim. Set the ready-check timeout to at least 300 seconds so the build has time to verify the app. wait_for_port / waitForPort probes the published TCP port from the platform — bind the process to 0.0.0.0, not 127.0.0.1.

Build from a public image

Build from a Dockerfile

Pass the Dockerfile contents directly. Put system packages and language installs in the Dockerfile. Set start_cmd and ready_cmd on the builder so the app is launched and checked.
Set disk large enough for the image layers plus packages you install during the build. If the build fails with a disk check error, increase .disk(...).

Compare base sizes

The three base templates share one toolchain. They differ in CPU, memory, and disk.

What’s included

Full definition: base.Dockerfile in the Python SDK examples.

Users and layout

Python is managed by uv, not apt python3. The seeded workspace venv is on PATH (python / pip resolve there). Prefer pip install or uv pip install into /workspace/.venv.

Start with a coding CLI

Building from the Dockerfile yourself is optional (custom packages, a baked CLAUDE.md, private variants). Prefer 8 GB+ disk if you do. Runtimes deny outbound traffic by default. Attach an identity provider secret — ANTHROPIC_API_KEY for claude, OPENAI_API_KEY for codex — and a network policy that allows the model API. At minimum allow api.anthropic.com or api.openai.com on TCP 443, and add auth or package-registry hosts when you need them. Step-by-step: Claude Code on Gravix Layer.

What a build keeps

The Docker filesystem becomes the runtime image. Some image settings are applied. Others are ignored so platform defaults stay in effect.

Supported

Not supported (silently ignored)

These may appear in a Dockerfile or image config. The build continues and uses platform defaults. The build does not fail because of them. Platform-owned env keys from the image are also skipped when merging: PATH, HOME, HOSTNAME, SHELL, USER, LOGNAME.
If your Dockerfile relies on CMD or ENTRYPOINT to start a server, set .start_cmd(...) (and usually .ready_cmd(...)) on TemplateBuilder, or start processes with run_cmd after create.

Not supported (will fail or is unavailable)

Call the builder

List your templates

Read the build status

Prefer build_and_wait for a simple blocking workflow. It starts the build and polls until a terminal status.

Endpoint

POST /v1/agents/runtime POST /v1/agents/template/build GET /v1/agents/template · GET /v1/agents/template/:id · DELETE /v1/agents/template/:id