Skip to content

Commit 604647f

Browse files
Reduce disk space used when building kernel images
1 parent d7e3958 commit 604647f

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Dockerfile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ RUN ARCH=arm64 \
8282
CFLAGS="-march=armv8-a" \
8383
make \
8484
-j8 \
85-
Image.gz
85+
Image.gz && \
86+
cp /root/linux-6.15.2/build/arch/arm64/boot/Image.gz /root/zImage-arm64 \
87+
&& rm -rf /root/linux-6.15.2
8688

8789
################################################################################
8890
# KERNEL-ARM64BE #
@@ -104,7 +106,9 @@ WORKDIR /root/linux-6.15.2/build/
104106

105107
RUN make \
106108
-j8 \
107-
bzImage
109+
bzImage && \
110+
cp /root/linux-6.15.2/build/arch/x86_64/boot/bzImage /root/bzImage-x64 \
111+
&& rm -rf /root/linux-6.15.2
108112

109113
################################################################################
110114
# BUSYBOX SOURCE #
@@ -401,9 +405,9 @@ RUN ssh-keygen -f /root/.ssh/id_rsa -N ""
401405
RUN cp /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys
402406
ENV FRIDA_INJECT=/usr/bin/frida-inject-64
403407

404-
COPY --from=kernel-arm64 /root/linux-6.15.2/build/arch/arm64/boot/Image.gz /root/zImage-arm64
408+
COPY --from=kernel-arm64 /root/zImage-arm64 /root/zImage-arm64
405409
COPY --from=kernel-arm64be /root/zImage-arm64be /root/zImage-arm64be
406-
COPY --from=kernel-x64 /root/linux-6.15.2/build/arch/x86_64/boot/bzImage /root/bzImage-x64
410+
COPY --from=kernel-x64 /root/bzImage-x64 /root/bzImage-x64
407411
COPY --from=initrd-arm64 /root/initramfs-arm64.img /root/initramfs-arm64.img
408412
COPY --from=initrd-arm64be /root/initramfs-arm64be.img /root/initramfs-arm64be.img
409413
COPY --from=initrd-x64 /root/initramfs-x64.img /root/initramfs-x64.img

0 commit comments

Comments
 (0)