fix: build with custom kernel/rootfs

Fix ONBUILD initramfs path

Signed-off-by: Serge Logvinov <serge.logvinov@sinextra.dev>
This commit is contained in:
Serge Logvinov 2021-06-20 18:51:20 +03:00 committed by talos-bot
parent 5b5089ab95
commit 0f659622d0
2 changed files with 4 additions and 3 deletions

View File

@ -499,6 +499,7 @@ RUN apk add --no-cache --update \
xorriso \ xorriso \
xz xz
ARG TARGETARCH ARG TARGETARCH
ENV TARGETARCH ${TARGETARCH}
COPY --from=install-artifacts / / COPY --from=install-artifacts / /
COPY --from=installer-build /installer /bin/installer COPY --from=installer-build /installer /bin/installer
RUN ln -s /bin/installer /bin/talosctl RUN ln -s /bin/installer /bin/talosctl
@ -514,10 +515,10 @@ ONBUILD RUN apk add --no-cache --update \
ONBUILD WORKDIR /initramfs ONBUILD WORKDIR /initramfs
ONBUILD ARG RM ONBUILD ARG RM
ONBUILD RUN xz -d /usr/install/${TARGETARCH}/initramfs.xz \ ONBUILD RUN xz -d /usr/install/${TARGETARCH}/initramfs.xz \
&& cpio -idvm < /usr/install/initramfs \ && cpio -idvm < /usr/install/${TARGETARCH}/initramfs \
&& unsquashfs -f -d /rootfs rootfs.sqsh \ && unsquashfs -f -d /rootfs rootfs.sqsh \
&& for f in ${RM}; do rm -rfv /rootfs$f; done \ && for f in ${RM}; do rm -rfv /rootfs$f; done \
&& rm /usr/install/initramfs \ && rm /usr/install/${TARGETARCH}/initramfs \
&& rm rootfs.sqsh && rm rootfs.sqsh
ONBUILD COPY --from=customization / /rootfs ONBUILD COPY --from=customization / /rootfs
ONBUILD RUN find /rootfs \ ONBUILD RUN find /rootfs \

View File

@ -31,7 +31,7 @@ FROM scratch AS customization
COPY --from=<custom kernel image> /lib/modules /lib/modules COPY --from=<custom kernel image> /lib/modules /lib/modules
FROM ghcr.io/talos-systems/installer:latest FROM ghcr.io/talos-systems/installer:latest
COPY --from=<custom kernel image> /boot/vmlinuz /usr/install/vmlinuz COPY --from=<custom kernel image> /boot/vmlinuz /usr/install/${TARGETARCH}/vmlinuz
``` ```
When building the image, the `customization` stage will automatically be copied into the rootfs. When building the image, the `customization` stage will automatically be copied into the rootfs.