Simple script and config (type-safe) for building custom Linux kernels for Firecracker MicroVMs

refactor: streamline Dockerfile by consolidating build steps and improving layer caching

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