Skip to content
docker · firecracker · python · fastapi · base-image

FastAPI-ready Python rootfs forFirecracker

A FastAPI-ready Alpine 3.21 + Python 3.12 Firecracker rootfs for long-lived dashboard-IDE endpoints — baking fastapi, uvicorn, starlette, websockets, and the requests/httpx stack so staff VMs boot ready.

Baked for instant boot

This is the long-lived deploy rootfs for endpoints submitted through the dashboard IDE — week-to-month TTL VMs where paying a build-time pip install is the right tradeoff for instant boot. Quick one-shot VMs keep the smaller alpine-python rootfs plus the shared pip-cache.

  • Runtime — Alpine 3.21 + Python 3.12.
  • Deployment — staff-side firecracker-ctl-net.
firecracker-python-webImage
Python 3.12Runtime
FastAPIServer lib
TAP/WireGuardNetwork

What it gives you

Features

FastAPI stack baked

fastapi, uvicorn, starlette, python-multipart, websockets, anyio, h11 and more ship as musllinux wheels already resolved on disk.

HTTP client stack

py3-pip, py3-requests, py3-httpx, py3-urllib3, py3-certifi via apk on top of the FastAPI server libraries.

cp-entrypoint stage image

Multi-stage Docker build whose final layer ships a cp entrypoint so an in-cluster stage Job copies /rootfs.ext4 onto the rootfs PVC.

Network + boot init

ca-certificates, iproute2, resolv.conf at 1.1.1.1/8.8.8.8; /init mounts /proc /sys /dev, brings up lo + eth0, then exec /entrypoint.

Rootfs & ecosystem

Overview

FastAPI-ready Python rootfs used by the staff-side Firecracker deployment (firecracker-ctl-net). Built as a multi-stage Docker image whose final layer (alpine 3.21 + /rootfs.ext4) ships a cp entrypoint so the in-cluster stage Job can run the image directly and copy /rootfs.ext4 onto the firecracker rootfs PVC.

This is the long-lived deploy rootfs for endpoints submitted through the dashboard IDE — week-to-month TTL VMs where paying a build-time pip install is the right tradeoff for instant boot. Quick one-shot VMs keep the smaller alpine-python rootfs plus the shared pip-cache.

  • Alpine 3.21 + Python 3.12
  • py3-pip, py3-requests, py3-httpx, py3-urllib3, py3-certifi (apk)
  • fastapi, uvicorn, starlette, python-multipart, email-validator, websockets, anyio, sniffio, h11, click (pip, musllinux wheels)
  • ca-certificates-bundle, ca-certificates, iproute2
  • /etc/resolv.conf with 1.1.1.1 and 8.8.8.8
  • /init mounts /proc, /sys, /dev, brings up lo + eth0, then exec /entrypoint
ImageDeploymentNetworkDNSrequests bakedFastAPI baked
alpine-pythonfirecracker-ctl (public quick)nonenonono
firecracker-python-netfirecracker-ctl-net (staff, short-lived)TAP via Gluetun/WireGuardyesyesno
firecracker-python-web (this)firecracker-ctl-net (staff, long-lived)TAP via Gluetun/WireGuardyesyesyes

Build & publish

Build & publish

Terminal window
npx nx run firecracker-python-web:container
npx nx run firecracker-python-web:extract

Output: packages/docker/firecracker/python/web/dist/python-web.ext4.

Terminal window
npx nx run firecracker-python-web:container:production

Pushes ghcr.io/kbve/firecracker-python-web:latest and :<version>.

Questions

Frequently asked

What is the firecracker-python-web rootfs?

It is a FastAPI-ready Alpine 3.21 plus Python 3.12 Firecracker rootfs image built for the staff-side long-lived deployment. It bakes fastapi, uvicorn, starlette, websockets, and the requests/httpx stack so VMs boot with the server libraries already on disk.

How does firecracker-python-web differ from the other Firecracker rootfs images?

alpine-python is the public quick rootfs with no network and no baked libraries, firecracker-python-net adds TAP networking, DNS, and the requests stack for short-lived staff VMs, and firecracker-python-web additionally bakes the FastAPI server stack for long-lived endpoints submitted through the dashboard IDE.

How is the firecracker-python-web image built and published?

It is a multi-stage Docker build whose final layer ships a cp entrypoint that copies /rootfs.ext4 onto the firecracker rootfs PVC. Build with nx run firecracker-python-web:container and extract; the production target pushes ghcr.io/kbve/firecracker-python-web at latest and the version tag.