Skip to content

Commit 4fbca16

Browse files
Further reduce disk usage for kernel build
1 parent 12deb44 commit 4fbca16

File tree

1 file changed

+17
-20
lines changed

1 file changed

+17
-20
lines changed

Dockerfile

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -62,22 +62,20 @@ RUN apt-get install -y nodejs
6262
FROM platform AS kernel-source
6363
WORKDIR /root/
6464
RUN wget https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.15.2.tar.xz
65-
RUN tar xf linux-6.15.2.tar.xz
6665

6766
################################################################################
6867
# KERNEL-ARM64 #
6968
################################################################################
7069
FROM platform AS kernel-arm64
71-
COPY --from=kernel-source /root/linux-6.15.2 /root/linux-6.15.2
72-
WORKDIR /root/linux-6.15.2
73-
74-
RUN mkdir build
75-
RUN ARCH=arm64 make O=/root/linux-6.15.2/build/ defconfig
76-
RUN echo "CONFIG_COMPAT=y" >> /root/linux-6.15.2/build/.config
77-
78-
WORKDIR /root/linux-6.15.2/build/
79-
80-
RUN ARCH=arm64 \
70+
WORKDIR /root/
71+
COPY --from=kernel-source /root/linux-6.15.2.tar.xz /root/linux-6.15.2.tar.xz
72+
RUN tar xf linux-6.15.2.tar.xz && \
73+
cd /root/linux-6.15.2 && \
74+
mkdir build && \
75+
ARCH=arm64 make O=/root/linux-6.15.2/build/ defconfig && \
76+
echo "CONFIG_COMPAT=y" >> /root/linux-6.15.2/build/.config && \
77+
cd /root/linux-6.15.2/build/ && \
78+
ARCH=arm64 \
8179
CROSS_COMPILE=aarch64-linux-gnu- \
8280
CFLAGS="-march=armv8-a" \
8381
make \
@@ -96,15 +94,14 @@ COPY --from=ghcr.io/frida/x-tools-linux-be-target /root/Image.gz /root/zImage-ar
9694
# KERNEL-x64 #
9795
################################################################################
9896
FROM platform AS kernel-x64
99-
COPY --from=kernel-source /root/linux-6.15.2 /root/linux-6.15.2
100-
WORKDIR /root/linux-6.15.2
101-
102-
RUN mkdir build
103-
RUN make O=/root/linux-6.15.2/build/ defconfig
104-
105-
WORKDIR /root/linux-6.15.2/build/
106-
107-
RUN make \
97+
WORKDIR /root/
98+
COPY --from=kernel-source /root/linux-6.15.2.tar.xz /root/linux-6.15.2.tar.xz
99+
RUN tar xf linux-6.15.2.tar.xz && \
100+
cd /root/linux-6.15.2 && \
101+
mkdir build && \
102+
make O=/root/linux-6.15.2/build/ defconfig && \
103+
cd /root/linux-6.15.2/build/ && \
104+
make \
108105
-j8 \
109106
bzImage && \
110107
cp /root/linux-6.15.2/build/arch/x86_64/boot/bzImage /root/bzImage-x64 \

0 commit comments

Comments
 (0)