Your First Build

Run a warden build

The basic flow is the same regardless of driver:

warden build .                           # Container driver (default)
warden build --driver qemu .             # QEMU driver
warden build --driver vz --script ./build.sh .  # VZ driver
warden build --driver hyperv .           # Hyper-V driver
warden build --driver firecracker .      # Firecracker driver

The VM drivers need a one-time setup first; see Installation and the drivers guide. For vz that starts with building warden from source on the Mac: a released warden has no vz driver.

For the container driver you can also point at a specific Dockerfile:

warden build ./my-project/Dockerfile.prod

The container driver uses the first of finch, podman and docker that answers, so with both docker and podman running it uses podman. On macOS and Windows a finch whose VM is stopped is passed over for a runtime that is up, and used, its VM started, only when none is. To choose one, name it (--runtime docker for docker):

warden build --runtime podman .

Those three names are the only values the runtime takes, on the command line, in WARDEN_CTR_CLI and in a warden.toml. A build whose runtime setting holds anything else (a path, a wrapper script, another runtime) stops before it runs anything, and the error says where the value is set and what to change. When it is set in the warden.toml of a repository you cloned, --runtime with one of the three builds it without editing the file. A runtime you name must also be installed and running: one that is not on PATH stops the build before it makes an output directory, and one whose VM or daemon is stopped fails the build at its first call to the runtime, which leaves the output directory as any failed build does. warden does not pick another in its place. Start it, or name another; warden doctor checks that the runtime answers. The container runtime has the rules and the errors.

finch on macOS and Windows is the exception: a build starts its stopped VM itself, at that first call, and says so before finch's own output:

[warden] finch's VM is stopped; starting it (finch vm start), as [driver.container] start_finch_vm is true (the default)
INFO[0000] Starting existing Finch virtual machine...

The VM stays running after the build. To have finch's VM started only by hand, set start_finch_vm = false under [driver.container]; a build then fails with the fix to run finch vm start. finch's VM has the details.

Built from its own directory, a repository's warden.toml is the config file, and it chooses more than the runtime: the driver, the relay image and its trust roots. It must be a regular file of at most 1 MiB. To build a repository you do not control, name your own file with --config or WARDEN_CONFIG; Building a repository you do not control has the list.

What you'll see

The output is consistent across all drivers:

[warden] Build ID: abc12345
[warden] ... (driver-specific startup messages) ...
warden-io: configuring network
warden-io: waiting for relay
warden-io: installing CA
warden-io: fetching build script
warden-io: running build.sh
... (build output) ...
[warden] Build complete
[warden] Output: warden-output

If the build environment exits before the build completes (the script powers off a VM, or the container's init fails), warden waits 10 seconds for the completion, then fails with the build environment exited before the build completed and a To fix: line naming the build's build-output.log, which holds the last thing the build printed.

Output directory

After the build completes (same structure for all drivers):

warden-output/
├── ledger.zst              # Cryptographic ledger (ledger if --no-compress)
├── ca.cert.pem.zst         # Ephemeral CA cert (ca.cert.pem if --no-compress)
├── driver.json             # Which driver ran the build, and where it was found
├── build-output.log        # Captured build console output
├── artifacts/              # Build outputs posted via warden-io post
│   └── myapp.whl
├── captures/               # Captured payloads (only with --capture)
├── payloads/               # Content-addressed payload storage
├── relay.log               # Relay event log (container and vz drivers)
├── inputs/                 # Only for a build from a Dockerfile (ORCH-02)
│   ├── Containerfile       #   the Dockerfile you submitted, unchanged
│   └── build.sh            #   the script it was translated to: what ran
└── console.log             # Build container console (container driver only)

Posting artifacts

To record a build output in the ledger, use warden-io post from within your build script or Dockerfile RUN step:

warden-io post /path/to/output.whl myapp-1.0.0.whl

The artifact is hashed, signed into the ledger, and saved in the output directory. This works identically in all drivers.

Fetching context files

To pull files from the host into your build environment:

# Fetch a single file:
warden-io fetch config.json -o /tmp/config.json

# Fetch entire context:
warden-io fetch . -o /workspace

This works in all drivers — the relay serves context files over HTTP regardless of whether the build environment is a container or VM.

A first Firecracker build

On an x86_64 Linux host with KVM, after the Firecracker setup:

warden doctor --driver firecracker           # every check should pass
warden image prepare --driver firecracker    # optional: caches ubuntu:24.04
warden build --driver firecracker .          # a Dockerfile FROM ubuntu:24.04

Doctor's output includes the build link and its source, for example build link 100.127.255.252/30 (default), then build link: no host interface overlaps it and firecracker direct-boot launcher initramfs: link-channel stamp current. A BLOCKED line names its fix; an initramfs built before the configurable build link is missing or stale until tools/firecracker-vm/build-initramfs.sh rebuilds it once.

A Dockerfile whose FROM is ubuntu:24.04, debian:bookworm or alpine:3.21 (or a build given --image <path>) boots that disk image, and the first build converts it once if you skipped image prepare. A --script build with no image boots straight from a small initramfs instead, which is faster but has only what your script brings:

warden build --driver firecracker --script build.sh ./src

If a build stops before booting with a DNS error, the host has no resolver the relay can use: only local ones (systemd-resolved's stub with no upstream, a local dnsmasq, or WSL's 10.255.255.254), or only ones inside the build link. The error says what to change: an off-host resolver on the host, or [vm] dns naming one. Upstream DNS covers it; moving the link is in Corporate Networks.

To look at the VMs after a build, add --keep-vms: both VMs keep running and warden prints their pids. Stop them, and any left by an interrupted build, with:

warden clean --driver firecracker

A first Hyper-V build

On Windows, after the Hyper-V setup, from a terminal in Hyper-V Administrators (no elevation needed):

warden doctor --driver hyperv                         # every check should pass
warden build --driver hyperv --guest-os windows ./win-project

Each build gets its own relay address on the NAT, its own claim token and one of the build switches warden setup made, so you can start several builds at once, up to the --slots you set up (4 by default). One more is refused before any VM boots, naming the VMs on each switch and --slots. A --keep-vms build keeps its switch until you remove its VMs with warden clean --driver hyperv; until then doctor lists the switch as in use by them. Clean never removes the build switches themselves.

The Windows build VM takes its address from the relay's DHCP lease. A guest that gets no lease waits for the relay, fails, and powers off; its warden-run.log and COM1 console record the address its NIC ended on and where it came from (WellKnown, no DHCP lease from the relay).

Interactive debugging (container driver)

warden shell .
# Drops into isolated container — all traffic still audited

warden clean leaves an open shell session alone, as it does a running build, while its warden-driver-container runs; see warden clean.

Custom output location

warden build -o ./my-custom-output .

Disabling compression

warden build --no-compress .