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.
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
Overview
Section titled “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.
What’s baked in
Section titled “What’s baked in”- 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.confwith1.1.1.1and8.8.8.8/initmounts/proc,/sys,/dev, brings uplo+eth0, thenexec /entrypoint
Three ecosystems
Section titled “Three ecosystems”| Image | Deployment | Network | DNS | requests baked | FastAPI baked |
|---|---|---|---|---|---|
alpine-python | firecracker-ctl (public quick) | none | no | no | no |
firecracker-python-net | firecracker-ctl-net (staff, short-lived) | TAP via Gluetun/WireGuard | yes | yes | no |
firecracker-python-web (this) | firecracker-ctl-net (staff, long-lived) | TAP via Gluetun/WireGuard | yes | yes | yes |
Build & publish
Build & publish
npx nx run firecracker-python-web:containernpx nx run firecracker-python-web:extractOutput: packages/docker/firecracker/python/web/dist/python-web.ext4.
Publish
Section titled “Publish”npx nx run firecracker-python-web:container:productionPushes 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.