| title | Quick Start: Initramfs Strategy |
|---|---|
| author | VolantVM |
| date | 2025-11-01 |
This path builds ultra-fast, minimal appliances using initramfs. Initramfs images boot in under 100ms and have minimal memory footprints, making them ideal for high-density or performance-critical workloads.
volar images install --manifest \
https://raw.githubusercontent.com/volantvm/initramfs-image-example/main/manifest/caddy.json
volar vms create web --image caddy --cpu 1 --memory 512Result: a microVM that boots in ~100ms and serves HTTP on its assigned IP.
curl -LO https://github.com/volantvm/fledge/releases/latest/download/fledge-linux-amd64
chmod +x fledge-linux-amd64 && sudo mv fledge-linux-amd64 /usr/local/bin/fledgeFledge uses two configuration files:
- fledge.toml - Defines how to build the image (build-time configuration)
- manifest.toml - Defines runtime defaults for VMs created from this image
This separation allows you to:
- Build images once with sensible defaults
- Create many VMs with different configurations
- Override settings without rebuilding
Create a directory for your image:
mkdir my-initramfs-app
cd my-initramfs-appversion = "1"
strategy = "initramfs"
[agent]
source_strategy = "release"
version = "latest"
[source]
# BusyBox defaults are applied automatically
# Override if you need a different build:
# busybox_url = "https://busybox.net/downloads/binaries/1.35.0-x86_64-linux-musl/busybox"
# busybox_sha256 = "6e123e7f3202a8c1e9b1f94d8941580a25135382b99e8d3e34fb858bba311348"
[mappings]
"./myapp" = "/usr/bin/myapp"schema_version = "v1"
name = "myapp"
version = "0.1.0"
runtime = "myapp"
# Resources section is OPTIONAL - omit to use defaults (cpu_cores=2, memory_mb=2048)
[resources]
cpu_cores = 1
memory_mb = 512
[workload]
type = "exec" # Can be "exec", "http", or "grpc"
entrypoint = ["/usr/bin/myapp"]
[env]
PORT = "8080"
LOG_LEVEL = "info"
[[network.expose]]
port = 8080
protocol = "tcp"sudo fledge buildThis will:
- Read both fledge.toml and manifest.toml
- Download and configure BusyBox
- Install the Kestrel agent
- Apply your file mappings
- Generate manifest.json and image.cpio.gz in the dist/ directory
# Install the image
volar images install dist/manifest.json
# Create a VM with defaults from manifest.toml
volar vms create demo --image myapp
# Or create a VM with overrides
volar vms create prod --image myapp \
--cpu 2 \
--memory 1024 \
--env LOG_LEVEL=debug
# List your VMs
volar vms list
# Check the VM's IP and access your app
volar vms show demo
curl http://<vm-ip>:8080Fledge can execute Dockerfiles using its embedded BuildKit and merge the result into the initramfs:
# fledge.toml
version = "1"
strategy = "initramfs"
[agent]
source_strategy = "release"
version = "latest"
[source]
dockerfile = "./Dockerfile"
context = "."
target = "final" # optional multi-stage target
[source.build_args]
APP_VERSION = "1.0.0"
[mappings]
"./extra-config" = "/etc/myapp/config.toml"# manifest.toml
schema_version = "v1"
name = "myapp"
version = "1.0.0"
runtime = "myapp"
# Resources section is OPTIONAL - omit to use defaults (cpu_cores=2, memory_mb=2048)
[resources]
cpu_cores = 2
memory_mb = 1024
[workload]
type = "exec" # Can be "exec", "http", or "grpc"
entrypoint = ["/usr/bin/myapp"]Then build:
sudo fledge buildSkip the config files and build directly from a Dockerfile:
sudo fledge build ./Dockerfile \
--context . \
--build-arg APP_VERSION=1.0.0 \
--output-initramfs \
--output myapp-initramfs
# Outputs: myapp-initramfs.cpio.gz + myapp-initramfs.manifest.jsonNote: When using direct CLI builds, you'll need to manually create a manifest.toml or edit the generated manifest.json to set runtime defaults.
The three-tier configuration system lets you customize VMs without rebuilding images:
# Development: verbose logging, minimal resources
volar vms create dev --image myapp \
--cpu 1 \
--memory 256 \
--env LOG_LEVEL=trace \
--env DEBUG=true
# Production: more resources, custom port mapping
volar vms create prod --image myapp \
--cpu 4 \
--memory 2048 \
--env LOG_LEVEL=warn \
--port 443:8080
# Staging: different environment config
volar vms create staging --image myapp \
--env DATABASE_URL=staging.db.example.com \
--env CACHE_URL=staging.cache.example.comThe override hierarchy:
- CLI flags (highest priority) override manifest defaults
- Manifest defaults (from manifest.toml) override system defaults
- System defaults (cpu=2, memory=2048) are the fallback
- See Initramfs Development Guide for deeper coverage
- Learn about Configuration Hierarchy
- Explore fledge.toml Reference
- Explore manifest.toml Reference