Back to Microsandbox

Examples

examples/README.md

0.5.11.9 KB
Original Source

Examples

Examples showing how to use the microsandbox SDK in Rust, Python, TypeScript, and Go.

Each language directory has its own README with setup and run instructions.

LanguageDirectoryREADME
Rustrust/rust/README.md
Pythonpython/python/README.md
TypeScripttypescript/typescript/README.md
Go../sdk/go/examples/../sdk/go/examples/README.md

Prerequisites

Some examples use git submodules for sample Alpine rootfs assets:

sh
git submodule update --init --recursive

Examples

ExampleDescription
root-ociCreate a sandbox from an OCI image (e.g. alpine)
root-bindCreate a sandbox from a local bind-mounted directory
root-blockCreate a sandbox from a qcow2 disk image
rootfs-patchPre-boot filesystem modifications (files, dirs, appends)
init-handoffHand PID 1 inside the guest off to systemd
volume-namedPersistent named volume shared between sandboxes
volume-diskMount raw / qcow2 disk images at arbitrary guest paths
fs-read-streamStream a large file from the sandbox in chunks
metrics-streamSubscribe to streaming resource metrics
shell-attachInteractive terminal session inside a sandbox
net-basicDNS resolution, HTTP fetch, interface status
net-dnsDNS filtering — block domains and suffixes
net-policyNetwork policies — public-only, allow-all, no-network
net-portsPort publishing — expose guest services on host ports
net-secretsSecret injection with TLS placeholder substitution
net-tlsTLS interception with per-domain cert generation