Skip to content

Commit

Permalink
fix: build with custom kernel/rootfs
Browse files Browse the repository at this point in the history
Fix ONBUILD initramfs path

Signed-off-by: Serge Logvinov <serge.logvinov@sinextra.dev>
  • Loading branch information
sergelogvinov authored and talos-bot committed Jun 21, 2021
1 parent 5b5089a commit 0f65962
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@ RUN apk add --no-cache --update \
xorriso \
xz
ARG TARGETARCH
ENV TARGETARCH ${TARGETARCH}
COPY --from=install-artifacts / /
COPY --from=installer-build /installer /bin/installer
RUN ln -s /bin/installer /bin/talosctl
Expand All @@ -514,10 +515,10 @@ ONBUILD RUN apk add --no-cache --update \
ONBUILD WORKDIR /initramfs
ONBUILD ARG RM
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 \
&& for f in ${RM}; do rm -rfv /rootfs$f; done \
&& rm /usr/install/initramfs \
&& rm /usr/install/${TARGETARCH}/initramfs \
&& rm rootfs.sqsh
ONBUILD COPY --from=customization / /rootfs
ONBUILD RUN find /rootfs \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ FROM scratch AS customization
COPY --from=<custom kernel image> /lib/modules /lib/modules
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.
Expand Down

0 comments on commit 0f65962

Please sign in to comment.