Beams are Kata containers that run in Cloud Hypervisor micro-VMs.
Phases are versioned and layered images for beam runtimes. A phase holds filesystem state and its build instructions.
Phases deliver a Git-like UX for container filesystems, combining continuous updates with persistent snapshots that you can fork and rebase from.
Unlike docker using layers to cache often stale build command results, phases use layers to represent reusable build stages, which beams rebuild automatically or users create interactively, like VM snapshots.
Phases let you:
- Define build stages in YAML, with automated periodic rebuilds.
- Write to
/homeinteractively, and take snapshots. - Copy local files into the container and persist them.
- Receive automatic updates to base layers via rebasing.
You can apply these steps in any order, creating a pipeline that composes mutable, immutable, and regenerated state, with rules that prevent unsafe mutations and data corruption.
Each step is called a phase. When a parent image refreshes, child phases compose a new image on top of it. Only rebuild phases rerun commands.
On refresh, regenerate rebuild layers and retain snapshot layers.
-
Base Base image 83c3f21a… 4b6a09ef… Rebuilt
-
Rebuild Outside /home b0193e72… 6ac8f931… Rebuilt
-
Snapshot /home c0174a0b… Retained
-
Rebuild Outside /home d01a520c… 91eb604a… Rebuilt
-
Snapshot /home e01721d8… Retained
Overview
There are three types of phases:
- Snapshot phases, which persist your changes in
/homein durable (but editable and forkable) layers. You can edit these until descendant snapshot phases depend on them – then you have to fork. - Rebuild phases, which periodically rerun commands to make changes outside of
/home(like a Dockerfile on a timer). You can change the commands between rebuilds. - Copy phases, which supply fixed sets of files outside of
/home(base image overlays, like Dockerfile’sCOPY --link). You can always edit these.
Separate saved home files from the paths managed by rebuild and copy phases.
Rebuild
/usr/ /etc/ …
Outside /home
+ Copy
/opt/dev/
Copy and rebuild paths can overlap.
Snapshot
/home/beams/
Saved interactive files
Let’s review a couple of examples. If you want to run the commands yourself, set up tsh in your local terminal first.
Install the client tools and sign in
Beams is a Teleport project and uses official Teleport client tools.
The client tools include tsh to sign in and run commands, and tctl to administer your cluster if you have permission.
Cluster: example.beams.run. Edit this example to use your cluster name.
Install version 18.11.10 of the client:
Download and open the macOS installer, then follow its instructions.
curl -O https://cdn.teleport.dev/teleport-tools-18.11.10.pkg
open teleport-tools-18.11.10.pkgFor Linux x86-64, download and install the client tools:
curl -O https://cdn.teleport.dev/teleport-v18.11.10-linux-amd64-bin.tar.gz
tar -xzf teleport-v18.11.10-linux-amd64-bin.tar.gz
sudo ./teleport/installFor Windows x86-64, run these commands in PowerShell. Add the extraction directory ($env:LOCALAPPDATA\Teleport) to your user PATH to use tsh in future terminals; the last command adds it to this terminal's PATH.
Invoke-WebRequest -Uri https://cdn.teleport.dev/teleport-v18.11.10-windows-amd64-bin.zip -OutFile teleport.zip
Expand-Archive -Path teleport.zip -DestinationPath "$env:LOCALAPPDATA\Teleport" -Force
$env:Path += ";$env:LOCALAPPDATA\Teleport"Follow the official client tools install guide for other versions and architectures.
Check that you’re running v18.11.10 of the client with tsh version.
tsh versionI sign in without a password (e.g. a passkey).
tsh login --proxy='example.beams.run' --auth=passwordlessI have a password & MFA set up for my account:
Replace you@example.com with your Teleport username.
tsh login --proxy='example.beams.run' --user=you@example.comI sign in with SSO (e.g. Okta, GitHub, SAML).
tsh login --proxy='example.beams.run'MicroVMs with snapshots and forks
A snapshot saves files, not running processes or memory. A fork gives you an independent copy of those files. For example, create a workspace from your local terminal:
tsh phase add workspace --from=default:v1Inside the build beam, save a file:
printf '%s\n' 'original workspace' > ~/notes.txt
tsh phase snapshot --finalBack in your local terminal, open a fork of the saved workspace:
tsh phase add beak-buttons --fork-from=workspaceInside the fork, cat ~/notes.txt should print original workspace. Save a different value:
printf '%s\n' 'beak buttons experiment' > ~/notes.txt
tsh phase snapshot --finalNow start another fork from workspace with tsh phase add flock-chat --fork-from=workspace in your local terminal. In that build beam, cat ~/notes.txt should still print original workspace; the first fork changed only its own copy. For more, see Forks.
Fork saved workspace files into independent environments with a shared base.
base
Shared environment parent
workspace
Saved /home stays intact
beak-buttons
Independent /home copy
flock-chat
Independent /home copy
Compose a copy, rebuild, and snapshot pipeline
This example builds a small text page without a repository, package install, or external service. Use a new directory on your workstation. Save this file as message.txt:
Hello from the copy layerSave this as phase.yaml in the same directory. The copy layer adds the message under /opt/dev. The rebuild layer prepares a display version outside /home using a command that can rerun when the base changes.
version: v1
metadata:
name: dev-files
from: default:v1
files:
- from: ./message.txt
to: /opt/dev/message.txt
---
version: v1
metadata:
name: environment
from: dev-files
commands:
- shell: tr '[:lower:]' '[:upper:]' < /opt/dev/message.txt > /opt/dev/banner.txtApply the configuration, then create the dev snapshot phase on top of it:
tsh phase apply -f phase.yaml &&
tsh phase add dev --from=environmentIn the build beam that opens, save the part you want to edit interactively:
printf '%s\n' 'Saved in the snapshot' > ~/caption.txt
tsh phase snapshot --finalFinally, add a second rebuild layer that reads both inputs and assembles the page. Save this as app.yaml on your workstation:
version: v1
metadata:
name: app
from: dev
commands:
- shell: cat /opt/dev/banner.txt /home/beams/caption.txt > /opt/dev/page.txtApply it and start a fresh beam from the resulting image:
tsh phase apply -f app.yaml &&
tsh beams add --phase=appInside the new beam, verify the copy input, the snapshot input, and the assembled output:
grep -Fx 'Hello from the copy layer' /opt/dev/message.txt &&
grep -Fx 'Saved in the snapshot' ~/caption.txt &&
printf '%s\n' 'HELLO FROM THE COPY LAYER' 'Saved in the snapshot' | cmp - /opt/dev/page.txtThe check prints the two input lines and exits successfully if page.txt contains exactly the uppercase banner followed by the saved caption.
Compose copy, rebuild, and editable snapshot stages in one pipeline.
-
base
Image
-
dev-files
Copy
-
environment
Rebuild
-
dev
Snapshot
-
app
Rebuild
environment → dev
banner.txt · generated
caption.txt · saved in dev
app → runtime
page.txt · banner + caption
dev is still editable, even though app depends on it. From your workstation, run tsh phase edit dev. In the build beam that opens, change ~/caption.txt and run tsh phase snapshot --final again. Saving dev triggers a rebuild of app. After the rebuild succeeds, a new beam from app will have the same banner and the updated caption in /opt/dev/page.txt. Beams that are already running keep their original image.
Phases are rebuilt continuously, with upstream changes triggering downstream changes. Only rebuild phases need to execute build commands during a refresh. Snapshot and copy phases are quickly stitched on top of new layers by updating image registry metadata.
By default, snapshots own /home, and rebuilds own everything else. You can also give a rebuild phase specific paths inside /home, like node_modules, using metadata.rebuild_home_paths. Later snapshots must leave those paths alone.
Phases provide a single model for container persistence and security patching that covers agentic development workflows, dev environments, building apps, and whatever else you do in containers.
Compatibility
Updating dependencies underneath a saved workspace is only useful if you can control which updates you get. For Teleport Beams, we start with a stable Debian base image, so OS security fixes arrive within an ABI-stable release. Rebuild phases rerun every 24 hours to pick up updates allowed by the commands you specify in phase.yaml, while snapshots preserve your work on top.
Tests can run as part of rebuilds as well, including long integration tests that require access to other services connected to Teleport. If the build fails, the previous published image stays available. You choose which updates to accept and how to test them in phase.yaml, and phases handle rebuilding the environment around your saved work.
How it works
The phases model can be implemented on any Linux-based platform that supports raw container primitives like OverlayFS, but here’s how we’ve implemented it for Teleport Beams.
Builds run in a Kubernetes pod, isolated in a Cloud Hypervisor microVM using Kata Containers. The pod has an unprivileged (but VM-like) user container and a privileged builder container. Before user code starts, a trusted launcher passes open file descriptors for the user container’s mount namespace, root, and cgroup to the builder over a Unix socket (SCM_RIGHTS). The builder enters that mount namespace, mounts an OverlayFS filesystem, and uses pivot_root to switch roots and detach the old root. The setup socket is then hidden from the user environment.
Isolated setup and snapshot capture inside a microVM, with an external OCI registry.
Kubernetes pod · Cloud Hypervisor microVM isolation
Trusted launcher
Before user code
Private setup socket
Builder receives file descriptors
User workload
OverlayFS root
setns → OverlayFS
pivot_root
Detach old root; hide setup socket
Snapshot request
Separate user socket
Freeze → capture layer → thaw
Quiesce filesystem writes, then resume before upload
OCI registry
Layers + manifests · outside the pod
For snapshots, the builder freezes the workload’s cgroup to quiesce filesystem writes, captures the writable layer, then thaws it before uploading. Image assembly, rebasing, and registry operations use the go-containerregistry (ggcr) library to manipulate layers and manifests directly on the registry.
Retention and access control
Teleport Beams automatically garbage collects data: unused images are deleted in less than 2 days. Once cloud tenant is suspended, all data in image registry is deleted in less than 3 weeks.
Each region has a dedicated ECR repository in that region. Snapshots are region-locked and access to them is not possible outside of that region. Beams cannot pull, upload, or download snapshots across regions.
Users cannot directly pull, download, or upload snapshots, including from inside of a beam, regardless of region.