Back to Microsandbox

TypeScript Examples

examples/typescript/README.md

0.4.41.3 KB
Original Source

TypeScript Examples

Prerequisites

  • Node.js >= 18
  • msb + libkrunfw installed (auto-downloaded by the npm postinstall script)
  • For root-bind and root-block: git submodule update --init --recursive

Setup

Each example is a standalone Node.js project. Install dependencies first:

sh
cd examples/typescript/<example>
npm install

Running

sh
npm start

For example:

sh
cd examples/typescript/root-oci
npm install
npm start

Examples

ExampleDescription
root-ociOCI image rootfs
root-bindBind-mounted local directory
root-blockqcow2 disk image
rootfs-patchPre-boot filesystem patches
init-handoffHand PID 1 off to systemd
volume-namedNamed volumes shared across sandboxes
volume-diskDisk image volumes (raw / qcow2) at guest paths
snapshot-forkSnapshot a stopped sandbox and boot a fresh one from it
fs-read-streamStreaming file read
metrics-streamStreaming resource metrics
shell-attachInteractive shell attach
net-basicBasic networking
net-dnsDNS filtering
net-policyNetwork policies
net-portsPort publishing
net-secretsSecret injection
net-tlsTLS interception