m "github.com/superradcompany/microsandbox/sdk/go".
Typical flow
Functions
m.CreateSandbox()
Example
Example
*Sandbox owns the VM process, call Close (or Stop + Close) when done. See Options for all configuration knobs.
Parameters
ctxcontext.Contextnamestringopts…SandboxOptionReturns
*Error, see Error Handling.m.GetSandbox()
Example
Example
Kind == ErrSandboxNotFound if no such sandbox exists. The returned *SandboxHandle exposes Connect, Start, Stop, Kill, Remove, Metrics, Logs, and snapshot methods.
Parameters
namestringReturns
m.ListSandboxes()
Example
Example
Returns
m.ListSandboxesWith()
Example
Example
SandboxFilter. Label selectors are AND-matched: a sandbox matches only if it carries every label in the filter.
Parameters
filterSandboxFilterReturns
m.NewSandboxFilter()
SandboxFilter that matches every sandbox. Chain WithLabels to narrow the results passed to ListSandboxesWith.
Returns
m.StartSandbox()
Example
Example
*Sandbox.
Parameters
namestringReturns
m.StartSandboxDetached()
Parameters
namestringReturns
m.RemoveSandbox()
Example
Example
Parameters
namestringm.AllSandboxMetrics()
Example
Example
Metrics snapshot for every running sandbox, keyed by sandbox name. Only running and draining sandboxes appear.
Returns
m.EnsureInstalled()
Example
Example
~/.microsandbox/, downloading them from the matching GitHub release if not. Call at startup to surface install errors up front; otherwise the first sandbox call handles it. The FFI library is embedded in the Go binary and loads automatically, EnsureInstalled does not govern it. Idempotent; options apply only to the first call.
Parameters
ctxcontext.Contextopts…SetupOptionm.IsInstalled()
Returns
true if the runtime is present at the expected version.m.SDKVersion()
Returns
“0.5.8”.m.RuntimeVersion()
Kind == ErrLibraryNotLoaded only if loading fails (e.g. unsupported platform or GLIBC mismatch).
Returns
Methods
The*Sandbox returned by CreateSandbox, StartSandbox, and SandboxHandle.Connect carries the methods below. *Sandbox is safe for concurrent use from multiple goroutines. The command-execution methods, Exec, ExecStream, Shell, and ShellStream, live on the same value and are documented under Execution.
sb.Name()
Returns
sb.FS()
Example
Example
Returns
sb.SSH()
Example
Example
Returns
sb.Logs()
Example
Example
exec.log. Backed by an on-disk file, so it works for running and stopped sandboxes alike without guest-agent protocol traffic. The default sources are stdout and stderr; add LogSourceOutput for PTY-merged output or LogSourceSystem for runtime and kernel diagnostics. The same method exists on SandboxHandle for callers that don’t want to start the sandbox first.
Parameters
optsLogOptionsTail, Since, Until, Sources. The zero value returns everything for the default stdout and stderr sources.Returns
sb.LogStream()
Example
Example
LogStreamOptions{Follow: true} to keep the stream open past current EOF and pick up new entries as they are written. Close the returned *LogStreamHandle when done. Also available on SandboxHandle.
Parameters
optsLogStreamOptionsSince or FromCursor start point.Returns
Recv in a loop.sb.Metrics()
Example
Example
Returns
sb.MetricsStream()
Example
Example
Metrics snapshot every interval. Sub-millisecond precision is rounded up; a zero or negative value uses the runtime minimum (~1 ms). Close the returned *MetricsStreamHandle when done.
Parameters
intervaltime.DurationReturns
Recv in a loop.sb.Attach()
Parameters
cmdstringargs…stringReturns
sb.AttachShell()
WithShell, defaults to /bin/sh). Blocks until the shell exits and returns its exit code.
Returns
sb.Stop()
Example
Example
WithStopTimeout to change it.
Parameters
opts…StopOptionWithStopTimeout(30 * time.Second).sb.RequestStop()
WaitUntilStopped to await termination.
sb.Kill()
Example
Example
fsync’d may be lost. Prefer Stop for graceful shutdown. Defaults to a five-second observation window; pass WithKillTimeout to change it.
Parameters
opts…KillOptionsb.RequestKill()
sb.RequestDrain()
sb.WaitUntilStopped()
Example
Example
Returns
sb.Detach()
Example
Example
WithDetached once the caller is done with the handle but the sandbox should keep running in the background. After Detach, the handle is invalid; a subsequent Close returns an error with Kind == ErrInvalidHandle. Reconnect later with GetSandbox.
sb.Close()
Example
Example
Kind == ErrInvalidHandle. For a sandbox created with WithDetached, Close stops the VM, use Detach instead to leave it running.
sb.OwnsLifecycle()
true, closing or stopping the handle terminates the sandbox (attached mode); false means it is detached. The error return covers stale handles and FFI failures; use OwnsLifecycleOrFalse when you don’t care.
Returns
true if attached.sb.OwnsLifecycleOrFalse()
OwnsLifecycle that swallows the error and returns false on any failure. Suitable for log lines and best-effort branching.
Returns
true if attached, false on detach or error.Options
Functional options forCreateSandbox. Map and slice options merge across repeated calls; single-value setters like WithImage replace. Simple setters are demonstrated by the Typical flow above.
WithImage()
"python:3.12", "docker.io/library/alpine"). Required unless WithSnapshot is used. Use WithImageDisk when a disk-image root needs an explicit filesystem type.
Parameters
imagestringWithOCIUpperSize()
Parameters
mebibytesuint32WithImageDisk()
"ext4". The disk format is inferred from the path extension (.qcow2, .raw, or .vmdk).
Parameters
pathstringfstypestringWithSnapshot()
WithImage. See Snapshots.
Parameters
pathOrNamestringWithMemory()
512 MiB.
Parameters
mebibytesuint32WithCPUs()
1.
Parameters
cpusuint8WithWorkdir()
Parameters
pathstringWithShell()
Shell and AttachShell. Defaults to /bin/sh on most images.
Parameters
shellstring“/bin/bash”.WithSecurityProfile()
SecurityProfileRestricted applies stronger hardening: sets no_new_privs, drops mount-admin capability from user commands, and forces nosuid,nodev on user mounts.
Parameters
profileSecurityProfileWithEnv()
Parameters
envmap[string]stringWithLabels()
ListSandboxesWith filtering. Called repeatedly, the maps merge; later keys overwrite earlier ones. Keys must not use the reserved prefixes sandbox., microsandbox., or service..
Parameters
labelsmap[string]stringWithLabel()
WithLabels with one entry.
Parameters
keystringvaluestringWithHostname()
Parameters
hostnamestringWithUser()
Parameters
userstringWithReplace()
WithReplaceWithTimeout to set a different window.
WithReplaceWithTimeout()
WithReplace but with a caller-specified timeout between SIGTERM and SIGKILL. Implies WithReplace, calling this alone is enough. A zero duration skips SIGTERM and SIGKILLs immediately.
Parameters
timeouttime.DurationWithDetached()
GetSandbox. Note that Close stops a detached sandbox, use Detach to leave it running.
WithEphemeral()
Parameters
ephemeralbooltrue to delete all state on termination.WithEntrypoint()
WithInit instead.
Parameters
cmd…stringWithInit()
Example
Example
cfg via the Init factory. See Custom init system for image picks and shutdown semantics.
Parameters
cfgInitConfigWithLogLevel()
LogLevel.
Parameters
levelLogLevelWithQuietLogs()
WithScripts()
/.msb/scripts/<name> inside the guest. Scripts are added to PATH and can be called by name. Called repeatedly, entries merge; later names overwrite earlier ones.
Parameters
scriptsmap[string]stringWithPullPolicy()
PullPolicy.
Parameters
WithMaxDuration()
Parameters
dtime.DurationWithIdleTimeout()
Parameters
dtime.DurationWithRegistryAuth()
RegistryAuth.
Parameters
authRegistryAuthWithPorts()
127.0.0.1. Called repeatedly, the maps merge.
Parameters
portsmap[uint16]uint16WithPortsUDP()
127.0.0.1.
Parameters
portsmap[uint16]uint16WithPortBindings()
0.0.0.0. See PortBinding for the type definition and UDP examples.
Parameters
bindings…PortBindingWithNetwork()
Example
Example
NetworkPolicy factory or a *NetworkConfig literal. See Networking.
Parameters
WithSecrets()
Secret factory. See Secrets.
Parameters
secrets…SecretEntryWithPatches()
Example
Example
Patch factory.
Parameters
patches…PatchConfigWithMounts()
Example
Example
Mount factory. Called repeatedly, the maps merge; later entries overwrite earlier ones for the same guest path. See Volumes.
Parameters
mountsmap[string]MountConfigWithStopTimeout()
Stop waits for graceful shutdown before force-killing. Default: 10 seconds. This is a StopOption, not a SandboxOption, pass it to Stop.
Parameters
timeouttime.DurationWithKillTimeout()
Kill waits for stopped-state observation. Default: 5 seconds. This is a KillOption, pass it to Kill.
Parameters
timeouttime.DurationWithSkipDownload()
EnsureInstalled from fetching the msb + libkrunfw bundle from GitHub. Use when the runtime is already on disk at the install path (e.g. air-gapped CI). The embedded FFI library is unaffected. This is a SetupOption, pass it to EnsureInstalled.
Patch
Factory that constructs rootfs patches forWithPatches. Access via the package-level Patch value. Each method returns a PatchConfig. Mkdir and Remove are idempotent; other operations error at boot when targeting a path already present in the image unless Replace: true is passed in PatchOptions. See Patches for conceptual context.
Patch.Text()
path.
Parameters
pathstringcontentstringoptsPatchOptionsMode and Replace.Patch.Append()
content to an existing file at path. If the file lives in a lower image layer, it is copied up first.
Parameters
pathstringcontentstringPatch.Mkdir()
opts.Mode is honored; Replace is ignored.
Parameters
pathstringoptsPatchOptionsMode applies.Patch.Remove()
path. Idempotent.
Parameters
pathstringPatch.Symlink()
link pointing to target. Only opts.Replace is honored.
Parameters
targetstringlinkstringoptsPatchOptionsReplace applies.Patch.CopyFile()
src into the guest rootfs at dst.
Parameters
srcstringdststringoptsPatchOptionsMode and Replace.Patch.CopyDir()
src into the guest rootfs at dst. Only opts.Replace is honored.
Parameters
srcstringdststringoptsPatchOptionsReplace applies.Init
Factory that constructsInitConfig values for WithInit, handing off PID 1 inside the guest after agentd setup. Access via the package-level Init value. See Custom init system for image picks and shutdown semantics.
Init.Auto()
Example
Example
/sbin/init, /lib/systemd/systemd, …) inside the guest.
Returns
Init.Cmd()
Example
Example
cmd must be an absolute path inside the guest rootfs.
Parameters
cmdstringoptsInitOptionsTypes
SandboxHandle
Returned by GetSandbox() · ListSandboxes() · ListSandboxesWith()
A lightweight reference to a sandbox’s persisted state. Carries metadata (name, status, config JSON, timestamps) and offers lifecycle methods that operate on the sandbox without an active guest-agent connection. You cannotExec or FS on a handle, call Connect or Start to upgrade to a full *Sandbox.
| Method | Returns | Description |
|---|---|---|
Name() | string | Sandbox name, up to 128 UTF-8 bytes |
Status() | SandboxStatus | Last-known lifecycle status |
ConfigJSON() | string | Raw JSON configuration |
Config() | (*SandboxConfig, error) | Parsed configuration |
CreatedAt() | time.Time | Creation time, zero value if unknown |
UpdatedAt() | time.Time | Last-update time, zero value if unknown |
Refresh(ctx) | (*SandboxHandle, error) | Fresh handle for the same name |
Metrics(ctx) | (*Metrics, error) | Point-in-time resource metrics |
Logs(ctx, opts) | ([]LogEntry, error) | Read captured exec.log (works without starting) |
LogStream(ctx, opts) | (*LogStreamHandle, error) | Stream captured output |
Connect(ctx) | (*Sandbox, error) | Reattach to the running sandbox |
Start(ctx) | (*Sandbox, error) | Boot a stopped sandbox in attached mode |
StartDetached(ctx) | (*Sandbox, error) | Boot a stopped sandbox in detached mode |
Stop(ctx, opts...) | error | Graceful shutdown; accepts StopOption |
RequestStop(ctx) | error | Async stop request |
Kill(ctx, opts...) | error | Force terminate; accepts KillOption |
RequestKill(ctx) | error | Async kill request |
RequestDrain(ctx) | error | Async drain request |
WaitUntilStopped(ctx) | (*SandboxStopResult, error) | Block until terminal state |
Remove(ctx) | error | Delete sandbox and persisted state |
Snapshot(ctx, name) | (*SnapshotArtifact, error) | Snapshot a stopped sandbox under a bare name |
SnapshotTo(ctx, path) | (*SnapshotArtifact, error) | Snapshot a stopped sandbox to an explicit path |
SandboxFilter
Built by NewSandboxFilter() · used by ListSandboxesWith()
Narrows the results ofListSandboxesWith. The zero value matches every sandbox. Built fluently; WithLabels returns a new value so calls chain.
| Method | Returns | Description |
|---|---|---|
WithLabels(labels) | SandboxFilter | Require all of these labels (AND-matched). Repeated calls merge; later keys overwrite earlier ones |
SandboxConfig
Populated by SandboxOption · parsed by SandboxHandle.Config()
The full configuration of a sandbox. Most callers build a sandbox viaCreateSandbox(ctx, name, ...opts); SandboxConfig is exported for callers that prefer to construct a value directly.
| Field | Type | Description |
|---|---|---|
| Name | string | Sandbox name, up to 128 UTF-8 bytes |
| Image | string | OCI image, local path, or disk image |
| ImageFstype | string | Optional inner filesystem type for disk-image roots |
| OCIUpperSizeMiB | uint32 | Writable overlay upper size for OCI image roots |
| Snapshot | string | Snapshot artifact path or bare name; mutually exclusive with Image |
| MemoryMiB | uint32 | Guest memory in MiB |
| CPUs | uint8 | Virtual CPUs |
| Workdir | string | Default working directory |
| Shell | string | Shell binary used by Shell calls |
| SecurityProfile | SecurityProfile | In-guest security profile |
| Hostname | string | Guest hostname |
| User | string | Default guest user |
| Replace | bool | Replace existing sandbox with same name |
| ReplaceWithTimeout | *time.Duration | Timeout between SIGTERM and SIGKILL (implies Replace) |
| Env | map[string]string | Environment variables |
| Labels | map[string]string | Labels for metrics attribution and filtering |
| Detached | bool | If true, sandbox survives after the process exits |
| Ephemeral | bool | If true, all state is removed on termination |
| Entrypoint | []string | Override image entrypoint |
| Init | *InitConfig | Hand PID 1 off to a guest init binary |
| LogLevel | LogLevel | Sandbox log verbosity override |
| QuietLogs | bool | Suppress sandbox-level log output |
| Scripts | map[string]string | Named scripts mounted at /.msb/scripts/ |
| PullPolicy | PullPolicy | Image pull behavior |
| MaxDuration | time.Duration | Maximum sandbox lifetime |
| IdleTimeout | time.Duration | Idle timeout |
| RegistryAuth | *RegistryAuth | Private registry credentials |
| Ports | map[uint16]uint16 | Host to guest TCP port mappings |
| PortsUDP | map[uint16]uint16 | Host to guest UDP port mappings |
| PortBindings | []PortBinding | Port mappings with explicit bind addresses |
| Network | *NetworkConfig | Network policy and configuration |
| Secrets | []SecretEntry | Secret injection entries |
| Patches | []PatchConfig | Rootfs modifications applied before boot |
| Volumes | map[string]MountConfig | Volume mounts keyed by guest path |
SandboxOption
Consumed by CreateSandbox()
CreateSandbox. Every WithX helper in the Options section returns one. The lifecycle setters WithStopTimeout and WithKillTimeout return distinct StopOption / KillOption types passed to Stop and Kill instead.
Metrics
Returned by Metrics() · MetricsStream() · AllSandboxMetrics()
Point-in-time resource usage snapshot.| Field | Type | Description |
|---|---|---|
| CPUPercent | float64 | CPU usage as a percentage |
| VCPUTimeNs | uint64 | Cumulative vCPU time in nanoseconds |
| MemoryBytes | uint64 | Current memory usage in bytes |
| MemoryAvailableBytes | *uint64 | Guest-reported available memory when known |
| MemoryHostResidentBytes | *uint64 | Host RSS backing the guest when known |
| MemoryLimitBytes | uint64 | Memory limit in bytes |
| DiskReadBytes | uint64 | Total bytes read from disk since boot |
| DiskWriteBytes | uint64 | Total bytes written to disk since boot |
| NetRxBytes | uint64 | Total bytes received over the network since boot |
| NetTxBytes | uint64 | Total bytes sent over the network since boot |
| UpperUsedBytes | *uint64 | Guest-visible OCI upper filesystem used bytes when the protected reporter is available and fresh |
| UpperFreeBytes | *uint64 | Guest-visible OCI upper filesystem free bytes when the protected reporter is available and fresh |
| UpperHostAllocatedBytes | *uint64 | Host-allocated bytes for the writable OCI upper image when available |
| Uptime | time.Duration | Time since the sandbox was created |
MetricsStreamHandle
Returned by MetricsStream()
Live metrics subscription. CallClose to release Rust-side resources.
| Method | Returns | Description |
|---|---|---|
Recv(ctx) | (*Metrics, error) | Block until the next snapshot arrives. Returns (nil, nil) when the stream ends (sandbox exited) |
Close() | error | Stop the stream and release Rust-side resources |
SandboxStopResult
Returned by WaitUntilStopped()
Describes a terminal sandbox state observed byWaitUntilStopped.
| Field | Type | Description |
|---|---|---|
| Name | string | Sandbox name |
| Status | SandboxStatus | Terminal status (stopped or crashed) |
| ExitCode | *int | Process exit code when known |
| Signal | *int | Terminating signal when known |
| ObservedAt | time.Time | When the terminal state was observed |
| Source | *string | Origin of the stop observation when known |
SandboxStatus
Used by SandboxHandle.Status() · SandboxStopResult.Status
| Constant | Value | Description |
|---|---|---|
SandboxStatusRunning | "running" | Guest agent is ready; Exec, Shell, FS work |
SandboxStatusStopped | "stopped" | VM shut down; configuration persisted; can be restarted |
SandboxStatusCrashed | "crashed" | VM exited unexpectedly (kernel panic, OOM, etc.) |
SandboxStatusDraining | "draining" | Graceful shutdown in progress; existing commands finish, new ones rejected |
SandboxStatusPaused | "paused" | VM is paused |
LogEntry
Returned by Logs() · LogStream()
A single captured log entry.| Field | Type | Description |
|---|---|---|
| Source | LogSource | Origin of the captured data |
| SessionID | *uint64 | Relay-monotonic session id; nil for system entries |
| Timestamp | time.Time | Wall-clock capture time on the host |
| Data | []byte | The captured bytes |
| Cursor | string | Opaque resume token; pass to LogStreamOptions.FromCursor |
| Method | Returns | Description |
|---|---|---|
Text() | string | Captured bytes as a string |
LogOptions
Used by Logs()
Filters passed toLogs. The zero value returns everything for the default sources (stdout + stderr).
| Field | Type | Description |
|---|---|---|
| Tail | uint64 | Keep only the last N matching entries |
| Since | time.Time | Inclusive lower timestamp bound |
| Until | time.Time | Exclusive upper timestamp bound |
| Sources | []LogSource | Sources to include; empty = stdout + stderr. Add LogSourceOutput or LogSourceSystem for PTY-merged output or runtime/kernel diagnostics |
LogStreamOptions
Used by LogStream()
Configures a live log stream. The zero value reads the default sources from the beginning with follow off.Since and FromCursor are mutually exclusive.
| Field | Type | Description |
|---|---|---|
| Sources | []LogSource | Sources to include; empty = stdout + stderr + output |
| Since | time.Time | Start at the first entry with timestamp >= this; mutually exclusive with FromCursor |
| FromCursor | string | Resume strictly after the entry whose Cursor matches; mutually exclusive with Since |
| Until | time.Time | Stop at the first entry with timestamp >= this |
| Follow | bool | Keep the stream open past EOF and yield new entries as written |
LogStreamHandle
Returned by LogStream()
Live log subscription. CallClose to release Rust-side resources.
| Method | Returns | Description |
|---|---|---|
Recv(ctx) | (*LogEntry, error) | Block until the next entry arrives. Returns (nil, nil) when the stream ends |
Close() | error | Stop the stream and release Rust-side resources |
LogSource
Used by LogEntry.Source · LogOptions.Sources · LogStreamOptions.Sources
| Constant | Value | Description |
|---|---|---|
LogSourceStdout | "stdout" | Captured stdout (pipe mode, streams stayed separated) |
LogSourceStderr | "stderr" | Captured stderr (pipe mode) |
LogSourceOutput | "output" | PTY-merged stdout and stderr from a session running in pty mode |
LogSourceSystem | "system" | Synthetic lifecycle markers plus runtime/kernel diagnostic lines |
LogLevel
Used by WithLogLevel()
| Constant | Value | Description |
|---|---|---|
LogLevelDefault | "" | Runtime default |
LogLevelTrace | "trace" | Most verbose, all diagnostic output |
LogLevelDebug | "debug" | Debug and higher |
LogLevelInfo | "info" | Info and higher |
LogLevelWarn | "warn" | Warnings and errors only |
LogLevelError | "error" | Errors only |
PullPolicy
Used by WithPullPolicy()
| Constant | Value | Description |
|---|---|---|
PullPolicyDefault | "" | Runtime default (currently PullPolicyIfMissing) |
PullPolicyAlways | "always" | Pull every time, even if cached locally |
PullPolicyIfMissing | "if-missing" | Pull only if not already cached |
PullPolicyNever | "never" | Never pull; fail if missing |
SecurityProfile
Used by WithSecurityProfile()
| Constant | Value | Description |
|---|---|---|
SecurityProfileDefault | "default" | Normal guest-root semantics |
SecurityProfileRestricted | "restricted" | Stronger hardening: no_new_privs, dropped mount-admin capability, forced nosuid,nodev on user mounts |
RegistryAuth
Used by WithRegistryAuth()
Credentials for a private OCI registry.| Field | Type | Description |
|---|---|---|
| Username | string | Registry username |
| Password | string | Registry password |
InitConfig
Built by Init · used by WithInit()
Custom guest PID-1 init specification. Construct via theInit factory rather than building the struct directly.
| Field | Type | Description |
|---|---|---|
| Cmd | string | Absolute path inside the guest, or "auto" |
| Args | []string | Supplemental argv (argv[0] is implicitly Cmd) |
| Env | map[string]string | Extra env vars merged on top of the inherited env |
InitOptions
Used by Init.Cmd()
Tuning struct forInit.Cmd beyond the required cmd.
| Field | Type | Description |
|---|---|---|
| Args | []string | Supplemental argv |
| Env | map[string]string | Extra env vars |
Init
Produces InitConfig for WithInit()
Package-level factory namespace forInitConfig values. See the Init section for its methods.
| Method | Returns | Description |
|---|---|---|
Auto() | InitConfig | Auto-detect a guest init |
Cmd(cmd, opts) | InitConfig | Explicit init binary with argv and env |
PatchConfig
Built by Patch · used by WithPatches()
A single rootfs patch. Construct via thePatch factory; the fields populated depend on the PatchKind.
| Field | Type | Description |
|---|---|---|
| Kind | PatchKind | Patch flavour |
| Path | string | Absolute guest path (text / append / mkdir / remove) |
| Content | string | Text content (text / append) |
| Mode | *uint32 | File or directory mode, e.g. 0o644 |
| Replace | bool | When true, overwrite an existing path at the destination |
| Src | string | Host source path (copy_file / copy_dir) |
| Dst | string | Guest destination path (copy_file / copy_dir) |
| Target | string | Symlink target |
| Link | string | Symlink path |
PatchOptions
Used by Patch methods
Tuning struct passed toPatch methods that accept a mode and replace flag.
| Field | Type | Description |
|---|---|---|
| Mode | *uint32 | File or directory mode |
| Replace | bool | Overwrite an existing path |
PatchKind
Used by PatchConfig.Kind
PatchConfig. Prefer the Patch factory.
| Constant | Value |
|---|---|
PatchKindText | "text" |
PatchKindAppend | "append" |
PatchKindMkdir | "mkdir" |
PatchKindRemove | "remove" |
PatchKindSymlink | "symlink" |
PatchKindCopyFile | "copy_file" |
PatchKindCopyDir | "copy_dir" |
Patch
Produces PatchConfig for WithPatches()
Package-level factory namespace forPatchConfig values. See the Patch section for its methods.
| Method | Returns | Description |
|---|---|---|
Text(path, content, opts) | PatchConfig | Write UTF-8 text |
Append(path, content) | PatchConfig | Append to an existing file |
Mkdir(path, opts) | PatchConfig | Create a directory (idempotent) |
Remove(path) | PatchConfig | Delete a file or directory (idempotent) |
Symlink(target, link, opts) | PatchConfig | Create a symlink |
CopyFile(src, dst, opts) | PatchConfig | Copy a host file into the rootfs |
CopyDir(src, dst, opts) | PatchConfig | Copy a host directory into the rootfs |
SetupOption
Consumed by EnsureInstalled()
EnsureInstalled. The only helper is WithSkipDownload.