prepare for erofs
This commit is contained in:
24
Dockerfile
24
Dockerfile
@@ -9,8 +9,7 @@ run --mount=type=cache,id=novit-rs,target=/usr/local/cargo/registry \
|
||||
RUSTFLAGS="-C target-feature=-crt-static" cargo install --path . --root /dist
|
||||
|
||||
# ------------------------------------------------------------------------
|
||||
from alpine:3.23.4 as initrd
|
||||
run apk add zstd lz4
|
||||
from alpine:3.23.4 as system
|
||||
|
||||
workdir /system
|
||||
|
||||
@@ -31,9 +30,26 @@ run mkdir -p bin run var/log; cd bin && for cmd in init-version init-connect boo
|
||||
# check viability
|
||||
run chroot . init-version
|
||||
|
||||
run find * |cpio -H newc -oF /initrd
|
||||
# ------------------------------------------------------------------------
|
||||
from alpine:3.23.4 as initrd
|
||||
|
||||
copy --from=system /system /system
|
||||
run cd /system && find * |cpio -H newc -oF /initrd
|
||||
|
||||
# ------------------------------------------------------------------------
|
||||
from debian:stable-backports as initramfs
|
||||
run apt update && apt install -y erofs-utils
|
||||
|
||||
copy --from=system /system /system
|
||||
run mkfs.erofs \
|
||||
-z lzma -C131072 -Efragments,ztailpacking \
|
||||
-T0 --all-time --ignore-mtime \
|
||||
/initramfs /system
|
||||
|
||||
# ------------------------------------------------------------------------
|
||||
from alpine:3.23.4
|
||||
copy --from=initrd /initrd /
|
||||
copy --from=initrd /initrd /initrd
|
||||
entrypoint ["base64","/initrd"]
|
||||
|
||||
#copy --from=initramfs /initramfs /
|
||||
#entrypoint ["base64","/initramfs"]
|
||||
|
||||
Reference in New Issue
Block a user