@@ -126,43 +126,45 @@ RUN tar -C /root/ -j -x -v -f /tmp/busybox-1.36.1.tar.bz2
126126FROM platform AS busybox-arm64
127127COPY --from=busybox-source /root/busybox-1.36.1 /root/busybox-1.36.1
128128WORKDIR /root/busybox-1.36.1
129- RUN mkdir build
129+ RUN mkdir /root/busybox/
130130
131131RUN make \
132- O=/root/busybox-1.36.1/build \
132+ O=/root/busybox/ \
133133 CROSS_COMPILE=aarch64-linux-gnu- \
134134 CFLAGS="-march=armv8-a" \
135135 defconfig
136136
137- RUN echo "CONFIG_STATIC=y" >> /root/busybox-1.36.1/build /.config
138- RUN sed -i "s/CONFIG_TC=y/CONFIG_TC=n/g" /root/busybox-1.36.1/build /.config
137+ RUN echo "CONFIG_STATIC=y" >> /root/busybox/.config
138+ RUN sed -i "s/CONFIG_TC=y/CONFIG_TC=n/g" /root/busybox/.config
139139
140140RUN make \
141- O=/root/busybox-1.36.1/build \
141+ O=/root/busybox/ \
142142 CROSS_COMPILE=aarch64-linux-gnu- \
143143 CFLAGS="-march=armv8-a" \
144144 -j8 \
145- install
145+ install && \
146+ rm -rf /root/busybox-1.36.1
146147
147148# ###############################################################################
148149# BUSYBOX-x64 #
149150# ###############################################################################
150151FROM platform AS busybox-x64
151152COPY --from=busybox-source /root/busybox-1.36.1 /root/busybox-1.36.1
152153WORKDIR /root/busybox-1.36.1
153- RUN mkdir build
154+ RUN mkdir /root/busybox/
154155
155156RUN make \
156- O=/root/busybox-1.36.1/build \
157+ O=/root/busybox/ \
157158 defconfig
158159
159- RUN echo "CONFIG_STATIC=y" >> /root/busybox-1.36.1/build /.config
160- RUN sed -i "s/CONFIG_TC=y/CONFIG_TC=n/g" /root/busybox-1.36.1/build /.config
160+ RUN echo "CONFIG_STATIC=y" >> /root/busybox/.config
161+ RUN sed -i "s/CONFIG_TC=y/CONFIG_TC=n/g" /root/busybox/.config
161162
162163RUN make \
163- O=/root/busybox-1.36.1/build \
164+ O=/root/busybox/ \
164165 -j8 \
165- install
166+ install && \
167+ rm -rf /root/busybox-1.36.1
166168
167169# ###############################################################################
168170# INITRD-BASE #
@@ -192,10 +194,10 @@ COPY assets/initrd/entropy.c /root/entropy.c
192194# INITRD-ARM64 #
193195# ###############################################################################
194196FROM initrd-base AS initrd-arm64
195- COPY --from=busybox-arm64 /root/busybox-1.36.1/build /_install/bin /root/initramfs/bin/
196- COPY --from=busybox-arm64 /root/busybox-1.36.1/build /_install/sbin /root/initramfs/sbin/
197- COPY --from=busybox-arm64 /root/busybox-1.36.1/build /_install/usr /root/initramfs/usr/
198- COPY --from=busybox-arm64 /root/busybox-1.36.1/build /_install/linuxrc /root/initramfs/linuxrc
197+ COPY --from=busybox-arm64 /root/busybox/_install/bin /root/initramfs/bin/
198+ COPY --from=busybox-arm64 /root/busybox/_install/sbin /root/initramfs/sbin/
199+ COPY --from=busybox-arm64 /root/busybox/_install/usr /root/initramfs/usr/
200+ COPY --from=busybox-arm64 /root/busybox/_install/linuxrc /root/initramfs/linuxrc
199201RUN aarch64-linux-gnu-gcc \
200202 -march=armv8-a \
201203 -static \
@@ -322,10 +324,10 @@ RUN find . | cpio -o --format=newc -R root:root > /root/initramfs-arm64be.img
322324# INITRD-x64 #
323325# ###############################################################################
324326FROM initrd-base AS initrd-x64
325- COPY --from=busybox-x64 /root/busybox-1.36.1/build /_install/bin /root/initramfs/bin/
326- COPY --from=busybox-x64 /root/busybox-1.36.1/build /_install/sbin /root/initramfs/sbin/
327- COPY --from=busybox-x64 /root/busybox-1.36.1/build /_install/usr /root/initramfs/usr/
328- COPY --from=busybox-x64 /root/busybox-1.36.1/build /_install/linuxrc /root/initramfs/linuxrc
327+ COPY --from=busybox-x64 /root/busybox/_install/bin /root/initramfs/bin/
328+ COPY --from=busybox-x64 /root/busybox/_install/sbin /root/initramfs/sbin/
329+ COPY --from=busybox-x64 /root/busybox/_install/usr /root/initramfs/usr/
330+ COPY --from=busybox-x64 /root/busybox/_install/linuxrc /root/initramfs/linuxrc
329331RUN gcc \
330332 -static \
331333 -o /root/initramfs/sbin/entropy \
0 commit comments