MCPcopy
hub / github.com/firecracker-microvm/firecracker-containerd

github.com/firecracker-microvm/firecracker-containerd @main sqlite

repository ↗ · DeepWiki ↗
1,273 symbols 4,229 edges 131 files 431 documented · 34%
README

firecracker-containerd

BuildKite GitHub Actions

This repository enables the use of a container runtime, containerd, to manage Firecracker microVMs. Like traditional containers, Firecracker microVMs offer fast start-up and shut-down and minimal overhead. Unlike traditional containers, however, they can provide an additional layer of isolation via the KVM hypervisor.

Potential use cases of Firecracker-based containers include:

  • Sandbox a partially or fully untrusted third party container in its own microVM. This would reduce the likelihood of leaking secrets via the third party container, for example.
  • Bin-pack disparate container workloads on the same host, while maintaining a high level of isolation between containers. Because the overhead of Firecracker is low, the achievable container density per host should be comparable to running containers using kernel-based container runtimes, without the isolation compromise of such solutions. Multi-tenant hosts would particularly benefit from this use case.
  • Please note that multi-tenant use cases are at the user's own risk.

To maintain compatibility with the container ecosystem, where possible, we use container standards such as the OCI image format.

There are several components in this repository that enable containerd to use Firecracker microVMs to run containers:

  • A control plugin managing the lifecycle of the runtime and implementing our control API to manage the lifecycle of microVMs. The control plugin is compiled in to the containerd binary since building a Go plugin out-of-tree is hard, which requires us to build a specialized containerd binary for firecracker-containerd.
  • A runtime linking containerd (outside the microVM) to the Firecracker virtual machine monitor (VMM). The runtime is implemented as an out-of-process shim runtime communicating over ttrpc.
  • An agent running inside the microVM, which invokes runC via containerd's containerd-shim-runc-v1 to create standard Linux containers inside the microVM.
  • A root file filesystem image builder that constructs a firecracker microVM root filesystem containing runc and the firecracker-containerd agent.

For more detailed information on the components and how they work, see architecture.md.

Roadmap

To support the widest variety of workloads, firecracker-containerd has to work with popular container orchestration frameworks such as Kubernetes and Amazon ECS, so we will work to ensure that the software is conformant or compatible where necessary. The project currently allows you to launch a few containers colocated in the same microVM, and we are exploring how to raise the number of containers. We recently added support for configuring networking at the microVM level with CNI plugins and provide a CNI plugin suitable for chaining called "tc-redirect-tap". Our short term roadmap includes constraining or "jailing" the Firecracker VMM process to improve the host security posture. Our longer-term roadmap includes polishing, packaging, and generally making firecracker-containerd easier to run as well as exploring CRI conformance and compatibility with Kubernetes.

Details of specific roadmap items are tracked in GitHub issues.

Usage

For detailed instructions on building and running firecracker-containerd, see the getting started guide and the quickstart guide.

Questions?

Please use GitHub issues to report problems, discuss roadmap items, or make feature requests.

If you've discovered an issue that may have security implications to users or developers of this software, please do not report it using GitHub issues, but instead follow Firecracker's security reporting guidelines.

Other discussion: For general discussion, please join us in the #containerd channel on the Firecracker Slack.

License

This library is licensed under the Apache 2.0 License.

Extension points exported contracts — how you extend this code

HTTPClient (Interface)
HTTPClient defines the interface for the client getting metrics. [5 implementers]
snapshotter/demux/metrics/proxy.go
Provider (Interface)
Provider provides volumes from different sources. [3 implementers]
volume/set.go
IOProxy (Interface)
IOProxy is an interface to a particular implementation for initializing and copying the stdio of a process running in a [2 …
internal/vm/ioproxy.go
Getter (Interface)
The Getter interface provides an API for retrieving containerd events from a remote event source, such as an exchange. I [2 …
eventbridge/eventbridge.go
LocalNetworkServices (Interface)
LocalNetworkServices provides a way of running bare-bones DNS and HTTP servers bound to the ip of a created device, whic [1 …
internal/network_test_utils.go
MountableStubDrive (Interface)
A MountableStubDrive represents a stub drive that is ready to be patched and mounted once PatchAndMount is called. [1 …
runtime/drive_handler.go
ImageOpt (FuncType)
ImageOpt allows setting optional properties of the provider.
volume/image.go
FileOpt (FuncType)
FileOpt is a functional option that operates on an open file, modifying it to be usable by the jailer implementation pro
runtime/jailer.go

Core symbols most depended-on inside this repo

Error
called by 170
internal/debug/error.go
Close
called by 86
runtime/jailer.go
Name
called by 48
volume/set.go
String
called by 48
runtime/cpuset/cpuset_builder.go
Delete
called by 45
volume/set.go
Prepare
called by 36
internal/integtest/prepare.go
Stat
called by 35
snapshotter/demux/snapshotter.go
Wait
called by 31
runtime/service.go

Shape

Method 706
Function 410
Struct 132
Interface 15
FuncType 6
TypeAlias 4

Languages

Go100%

Modules by API surface

proto/firecracker.pb.go183 symbols
proto/types.pb.go124 symbols
runtime/service.go60 symbols
runtime/service_integ_test.go41 symbols
runtime/runc_jailer.go30 symbols
proto/service/ioproxy/ttrpc/ioproxy.pb.go30 symbols
proto/service/fccontrol/ttrpc/fccontrol_ttrpc.pb.go28 symbols
internal/vm/task_test.go26 symbols
agent/service.go24 symbols
snapshotter/demux/cache/cache_test.go23 symbols
proto/service/drivemount/ttrpc/drivemount.pb.go21 symbols
internal/vm/task.go21 symbols

Dependencies from manifests, versioned

cyphar.com/go-pathrsv0.2.1 · 1×
dario.cat/mergov1.0.0 · 1×
github.com/AdaLogics/go-fuzz-headersv0.0.0-2023081113042 · 1×
github.com/AdamKorcz/go-118-fuzz-buildv0.0.0-2023030612354 · 1×
github.com/Microsoft/go-winiov0.6.2 · 1×
github.com/Microsoft/hcsshimv0.12.9 · 1×
github.com/StackExchange/wmiv0.0.0-2018121223483 · 1×
github.com/asaskevich/govalidatorv0.0.0-2023030114320 · 1×
github.com/awslabs/tc-redirect-tapv0.0.0-2025051618333 · 1×
github.com/beorn7/perksv1.0.1 · 1×
github.com/blang/semver/v4v4.0.0 · 1×
github.com/cespare/xxhash/v2v2.3.0 · 1×

For agents

$ claude mcp add firecracker-containerd \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact