Create(WithTemplate("my-template")) to boot sandboxes that start from a known state.
TemplateSpec
TemplateSpec defines how to build a sandbox template.
| Field | Type | Description |
|---|---|---|
BaseImage | string | Base Docker image tag |
RunCmds | []string | Commands executed during the build |
Copies | []CopyItem | Files to copy into the template |
Envs | map[string]string | Environment variables baked in |
AptPackages | []string | Apt packages to install |
StartCmd | string | Command run when the sandbox starts |
Dockerfile | string | Raw Dockerfile (alternative to structured fields) |
DiskMB | int | Disk size in megabytes |
CopyItem
declaw.BuildTemplate()
Build a new template and wait for the build to complete.
(*BuildInfo, error)
declaw.BuildTemplateBackground()
Start a template build and return immediately without waiting for completion.
(*BuildInfo, error)
declaw.GetBuildStatus()
Poll the status of a background build.
(*BuildInfo, error)
declaw.ListTemplates()
List all templates owned by the caller.
([]TemplateInfo, error)
declaw.GetTemplate()
Get information about a specific template.
(*TemplateInfo, error)
declaw.DeleteTemplate()
Delete a template by its ID.
error