Skip to main content
POST
/
v1
/
templates
/
builds
Start a background template build
import requests

url = "https://api.13-215-85-171.sslip.io/v1/templates/builds"

payload = {}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
{ "build_id": "<string>", "template_id": "<string>", "name": "<string>", "tags": [ "<string>" ], "canonical_ref": "<string>", "namespace_slug": "<string>", "created_at": "2023-11-07T05:31:56Z", "updated_at": "2023-11-07T05:31:56Z", "source_digest": "<string>", "context_digest": "<string>", "dockerfile_digest": "<string>", "build_config": { "vcpus": 123, "memory_mib": 123, "internet_access": true, "disk_mb": 513 }, "triggered_by": "<string>", "queued_at": "2023-11-07T05:31:56Z", "started_at": "2023-11-07T05:31:56Z", "finished_at": "2023-11-07T05:31:56Z", "duration_ms": 123, "failure_phase": "<string>", "cache_summary": { "final_artifact_hits": 123, "final_artifact_misses": 123, "final_artifact_bypasses": 123, "final_artifact_stores": 123, "layer_hits": 123, "layer_misses": 123, "layer_bypasses": 123, "layer_stores": 123, "file_blob_hits": 123, "file_blob_misses": 123, "file_blob_bypasses": 123, "file_blob_stores": 123 }, "artifact_availability": { "reason": "<string>" }, "promotability": { "promotable": true, "reason": "<string>" }, "retention_expires_at": "2023-11-07T05:31:56Z", "runtime_defaults": { "default_env_keys": [ "<string>" ], "start_cmd": "<string>", "default_user": "<string>", "default_workdir": "<string>", "readiness": { "kind": "tcp", "port": 3000, "timeout_secs": 30, "interval_ms": 500, "startup_grace_secs": 2 } }, "oci_metadata": { "labels": {}, "exposed_ports": [ "<string>" ], "volumes": [ "<string>" ], "healthcheck": { "test": [ "<string>" ], "interval_ns": 123, "timeout_ns": 123, "start_period_ns": 123, "retries": 123, "mapped_readiness": { "kind": "tcp", "port": 3000, "timeout_secs": 30, "interval_ms": 500, "startup_grace_secs": 2 } } }, "artifact_ids": [ "<string>" ], "retry_of_build_id": "<string>", "original_build_id": "<string>", "cancel_requested_at": "2023-11-07T05:31:56Z", "cancel_requested_by": "<string>", "cancellation_reason": "<string>", "error": "<string>", "error_detail": { "message": "<string>", "retryable": true, "suggested_action": "<string>", "step_index": 123, "attempt": 123, "max_attempts": 123, "cache_subject": "<string>", "build_id": "<string>", "request_id": "<string>", "details": {} } }

Authorizations

Authorization
string
header
required

API key passed as Bearer token

Body

application/json
name
string

Template name (falls back to alias, then auto-generated)

dockerfile
string

Inline Dockerfile content

base_image
string

Base OCI image reference imported directly on the Firecracker path (for example ubuntu:22.04). The importer currently supports raw tar, gzip, and zstd layer media types; regular files, directories, symlinks, and hard links; and Linux OCI User values in user, uid, user:group, user:gid, uid:group, or uid:gid form. OCI special files such as sockets, FIFOs, block devices, and character devices are rejected. For image indexes, the importer prefers exact Firecracker-compatible Linux variants for the current host architecture (amd64/v1 or arm64/v8 / arm64/v8.0) and falls back to a variantless Linux manifest when present; manifests with os.version or non-empty os.features are rejected. Guest boot recreates /dev, /dev/pts, /dev/shm, /proc, and /sys through nullspace-init, so those do not need to come from imported OCI layers.

alias
string

Alternative name field used by SDK builders

tags
string[]

Tags assigned to the built artifact. Omit this field to use ["default"]; explicit empty arrays are invalid.

steps
object[]

Declarative builder steps converted to a Dockerfile server-side

build_envs
object

Environment variables available during template build only

start_cmd
string

Firecracker template start command executed during template build before snapshotting; sandboxes later restore the snapshotted running state instead of rerunning this command, and create-time env injection is not visible to it

build_context
object

Explicit local build context used to satisfy COPY/ADD sources during template builds

build_config
object

Optional build VM configuration (vCPUs, memory, internet access)

build_backend
enum<string>

Optional template build backend. Dockerfile builds default to BuildKit; declarative and external OCI import inputs use the native backend unless explicitly supported otherwise. Dockerfile input with native is rejected.

Available options:
native,
buildkit
dockerfile_path
string

Relative Dockerfile path inside the uploaded build context for BuildKit builds.

build_args
object

Safe-to-persist Dockerfile build arguments for BuildKit builds.

build_target
string

Optional Dockerfile target stage for BuildKit builds.

runtime_config
object

Firecracker-only runtime defaults baked into the built template

base_image_auth
object

Optional credentials for authenticated external OCI base-image imports. Applies to explicit base_image imports and Dockerfile builds that resolve to exactly one external non-template FROM image. Authenticated Dockerfile-backed imports currently reject variable-based FROM, alias-based imported stages, and multiple external registry hosts.

registry_auth
object[]

Optional per-registry request-time credentials for BuildKit Dockerfile pulls. Each registry must match a registry host used by the Dockerfile or base image. Secret values are forwarded only to the build worker and are not stored in durable build records.

build_secrets
object[]

Optional request-time BuildKit secrets exposed to Dockerfile RUN --mount=type=secret instructions. Supported only by the BuildKit backend. Values are forwarded only to the build worker and are not persisted in durable build records, cache keys, or context manifests.

skip_cache
boolean

Firecracker-only whole-build cache bypass

claim_token
string

Optional reserved template-name claim token

Response

Build accepted

build_id
string
required
template_id
string
required
name
string
required
tags
string[]
required
status
enum<string>
required
Available options:
waiting,
building,
ready,
error,
cancelled
build_backend
enum<string>
required

Template build backend. native is retained for declarative/OCI build requests and historical filters; Dockerfile build requests use buildkit.

Available options:
native,
buildkit
source_type
enum<string>
required
Available options:
declarative,
dockerfile,
oci_import,
template_base
canonical_ref
string
required
namespace_slug
string
required
visibility
enum<string>
required
Available options:
private,
public
created_at
string<date-time>
required
updated_at
string<date-time>
required
source_digest
string
context_digest
string
dockerfile_digest
string
build_config
object

Build VM resource configuration

triggered_by
string
queued_at
string<date-time>
started_at
string<date-time>
finished_at
string<date-time>
duration_ms
integer<uint64>
failure_phase
string
cache_summary
object
artifact_availability
object
promotability
object
retention_expires_at
string<date-time>
runtime_defaults
object

Effective runtime defaults retained for a built template. Environment values are intentionally omitted; only keys are exposed.

oci_metadata
object

OCI image metadata retained from Dockerfile or OCI imports. Volume declarations are metadata only and do not create persistent Nullspace volumes.

artifact_ids
string[]
retry_of_build_id
string
original_build_id
string
cancel_requested_at
string<date-time>
cancel_requested_by
string
cancellation_reason
string
error
string
error_detail
object