Running Firecracker inside Docker

3k Views Asked by At

Is there any way to run Firecracker inside Docker container.

I tried the basic networking in firecracker although having containerized firecracker can have many benefits

  1. No hurdle to create and manage overlay network and attach
  2. Deploy in Docker swarm and in Kubernetes
  3. No need to clean IPTables/Network rules etc.
4

There are 4 best solutions below

0
On

Nowadays, you can use Firecracker as a containerd runtime, thanks to the official firecracker-containerd project. You can learn how to set it up in the quick start guide.

Alternatively, if you do not insist on using Firecracker, you might want to consider gVisor, which is a similar project by Google built with containers in mind.

0
On

I came up with something very basic as this: https://github.com/s8sg/docker-firecracker

It allows creating go application that can run inside containerized firecracker

0
On
0
On

Setup Tutorial

You find a good tutorial with all the basics at the Weaveworks

it introduces

Ignite works like a One-to-One replacement for "docker", and it does work on my Raspberry PI 4, with Debian11 too.

How to use

Create and start a VM

 $ sudo ignite run weaveworks/ignite-ubuntu \
                --cpus 1 \
                --memory 1GB \
                --ssh \
                --name my-vm1

Show your VM Processes

 $ ignite ps

Login into your running VM

 $ sudo ignite ssh my-vm1

It takes a couple of sec to start (manualy) a new VM on my Raspberry PI 4 (8Gb, 64bit Debian11):

7 running VM on a Raspberry Pi4, Debian 11, qemu kvm

Login into any of these

$ sudo ignite ssh my-vm3

enter image description here

Footloose

If you add footloose you can start up a cluster of MicroVMs, which allows additional scenarios. It works more less like docker-swarm with VMs. Footloose reads a description of the Cluster of Machines to create from a file, by default named footloose.yaml. Please check

Note: be aware of a Apache ignite, which is a solution for something else, and don't get confused by it.

The initial idea for this answer is from my gist here