add initial initramfs support, not quite working yet

This commit is contained in:
2025-10-12 00:46:05 -07:00
parent fc239ea54d
commit 5f5ef1ddd3
6 changed files with 26 additions and 41 deletions

11
vm/Dockerfile.initramfs Normal file
View File

@@ -0,0 +1,11 @@
FROM alpine:3.22@sha256:4bcff63911fcb4448bd4fdacec207030997caf25e9bea4045fa6c8c44de311d1 AS build
RUN apk --no-cache add busybox-static
RUN mkdir -p /tmp/initramfs/bin && cp /bin/busybox.static /tmp/initramfs/bin/busybox && \
chroot /tmp/initramfs /bin/busybox --install -s /bin && \
chroot /tmp/initramfs ln -s /bin/sh /init && \
cd /tmp/initramfs && \
find . | cpio -R 0:0 --ignore-devno --renumber-inodes -o -H newc --quiet > /initramfs && \
rm -rf /tmp/initramfs
FROM scratch AS final
COPY --from=build /initramfs /initramfs