undo changes to Containerfile, to see why it's not working properly
This commit is contained in:
parent
f66d19b0f3
commit
257faf426f
|
@ -1,53 +1,62 @@
|
||||||
ARG TARGET=x86_64-unknown-linux-musl
|
|
||||||
|
|
||||||
FROM stagex/pallet-rust:sx2025.06.1 AS pallet-rust
|
FROM stagex/pallet-rust:sx2025.06.1 AS pallet-rust
|
||||||
FROM stagex/user-eif_build:sx2025.06.1 AS eif_build
|
FROM stagex/user-eif_build:sx2025.06.1 AS eif_build
|
||||||
FROM stagex/user-gen_initramfs:sx2025.06.1 AS gen_initramfs
|
FROM stagex/user-gen_initramfs:sx2025.06.1 AS gen_initramfs
|
||||||
FROM stagex/user-linux-nitro:sx2025.06.1 AS linux-nitro
|
FROM stagex/user-linux-nitro:sx2025.06.1 AS linux-nitro
|
||||||
|
|
||||||
FROM scratch as build-nit
|
FROM scratch as base
|
||||||
ARG TARGET
|
ENV TARGET=x86_64-unknown-linux-musl
|
||||||
# ENV TARGET=${TARGET}
|
|
||||||
ENV RUSTFLAGS="-C target-feature=+crt-static"
|
ENV RUSTFLAGS="-C target-feature=+crt-static"
|
||||||
ENV CARGOFLAGS="--locked --no-default-features --features aws --release --target ${TARGET}"
|
ENV CARGOFLAGS="--locked --no-default-features --release --target ${TARGET}"
|
||||||
|
ENV OPENSSL_STATIC=true
|
||||||
|
|
||||||
COPY --from=pallet-rust . /
|
|
||||||
COPY --from=linux-nitro /bzImage .
|
|
||||||
COPY --from=linux-nitro /linux.config .
|
|
||||||
ADD . /nit
|
|
||||||
WORKDIR /nit
|
|
||||||
RUN cargo build ${CARGOFLAGS}
|
|
||||||
|
|
||||||
FROM scratch AS build-eif
|
|
||||||
ARG TARGET
|
|
||||||
# ENV TARGET=${TARGET}
|
|
||||||
|
|
||||||
# just to provide us w/ some base utils. we should probably make some kind of
|
|
||||||
# base pallet that provides busybox and musl, just because i'm lazy and it's
|
|
||||||
# needed, well, everywhere
|
|
||||||
COPY --from=pallet-rust . /
|
COPY --from=pallet-rust . /
|
||||||
COPY --from=gen_initramfs . /
|
COPY --from=gen_initramfs . /
|
||||||
COPY --from=eif_build . /
|
COPY --from=eif_build . /
|
||||||
|
COPY --from=linux-nitro /bzImage .
|
||||||
|
COPY --from=linux-nitro /linux.config .
|
||||||
|
ADD . /src
|
||||||
|
|
||||||
|
FROM base as build
|
||||||
|
WORKDIR /src
|
||||||
|
RUN cargo build ${CARGOFLAGS}
|
||||||
WORKDIR /build_cpio
|
WORKDIR /build_cpio
|
||||||
COPY --from=build-nit /nit/target/${TARGET}/release/nit init
|
RUN cp /src/init/target/${TARGET}/release/nit init
|
||||||
ENV KBUILD_BUILD_TIMESTAMP=1
|
ENV KBUILD_BUILD_TIMESTAMP=1
|
||||||
COPY initramfs.list /build_cpio/initramfs.list
|
COPY <<-EOF initramfs.list
|
||||||
RUN find . -exec touch -hcd "@0" "{}" + && \
|
file /init init 0755 0 0
|
||||||
gen_init_cpio -t 1 initramfs.list > rootfs.cpio && \
|
dir /run 0755 0 0
|
||||||
|
dir /tmp 0755 0 0
|
||||||
|
dir /etc 0755 0 0
|
||||||
|
dir /bin 0755 0 0
|
||||||
|
dir /sbin 0755 0 0
|
||||||
|
dir /proc 0755 0 0
|
||||||
|
dir /sys 0755 0 0
|
||||||
|
dir /usr 0755 0 0
|
||||||
|
dir /usr/bin 0755 0 0
|
||||||
|
dir /usr/sbin 0755 0 0
|
||||||
|
dir /dev 0755 0 0
|
||||||
|
dir /dev/shm 0755 0 0
|
||||||
|
dir /dev/pts 0755 0 0
|
||||||
|
nod /dev/console 0600 0 0 c 5 1
|
||||||
|
EOF
|
||||||
|
RUN <<-EOF
|
||||||
|
find . -exec touch -hcd "@0" "{}" +
|
||||||
|
gen_init_cpio -t 1 initramfs.list > rootfs.cpio
|
||||||
touch -hcd "@0" rootfs.cpio
|
touch -hcd "@0" rootfs.cpio
|
||||||
|
EOF
|
||||||
WORKDIR /build_eif
|
WORKDIR /build_eif
|
||||||
COPY --from=linux-nitro /bzImage /build_eif/bzImage
|
|
||||||
COPY --from=linux-nitro /linux.config /build_eif/linux.config
|
|
||||||
RUN mkdir /build_eif/out
|
|
||||||
RUN eif_build \
|
RUN eif_build \
|
||||||
--kernel /build_eif/bzImage \
|
--kernel /bzImage \
|
||||||
--kernel_config /build_eif/linux.config \
|
--kernel_config /linux.config \
|
||||||
--ramdisk /build_cpio/rootfs.cpio \
|
--ramdisk /build_cpio/rootfs.cpio \
|
||||||
--pcrs_output /build_eif/out/nitro.pcrs \
|
--pcrs_output /nitro.pcrs \
|
||||||
--output /build_eif/out/nitro.eif \
|
--output /nitro.eif \
|
||||||
--cmdline 'reboot=k initrd=0x2000000,3228672 root=/dev/ram0 panic=1 pci=off nomodules console=ttyS0 i8042.noaux i8042.nomux i8042.nopnp i8042.dumbkbd'
|
--cmdline 'reboot=k initrd=0x2000000,3228672 root=/dev/ram0 panic=1 pci=off nomodules console=ttyS0 i8042.noaux i8042.nomux i8042.nopnp i8042.dumbkbd'
|
||||||
RUN ls -la /build_eif/out
|
|
||||||
|
|
||||||
FROM scratch AS package
|
FROM base as install
|
||||||
COPY --from=build-eif /build_eif/out /
|
WORKDIR /rootfs
|
||||||
|
COPY --from=build /nitro.eif .
|
||||||
|
COPY --from=build /nitro.pcrs .
|
||||||
|
|
||||||
|
FROM scratch as package
|
||||||
|
COPY --from=install /rootfs .
|
||||||
|
|
Loading…
Reference in New Issue