Simple script and config (type-safe) for building custom Linux kernels for Firecracker MicroVMs
1FROM denoland/deno:latest AS builder
2
3WORKDIR /app
4
5# Copy only the files needed for installing dependencies
6COPY deno.json deno.lock ./
7
8RUN deno install
9
10COPY . .
11
12RUN deno compile -A -o vmlinux-builder ./build.ts
13
14FROM ubuntu:latest
15
16RUN apt-get update && apt-get install -y \
17 git \
18 build-essential \
19 flex \
20 bison \
21 libncurses5-dev \
22 libssl-dev \
23 gcc \
24 bc \
25 libelf-dev \
26 pahole \
27 && rm -rf /var/lib/apt/lists/*
28
29COPY --from=builder /app/vmlinux-builder /usr/local/bin/vmlinux-builder
30
31ENTRYPOINT ["vmlinux-builder"]