Skip to content

Commit 12deb44

Browse files
Further reduce disk usage for busybox
1 parent 3ce27f8 commit 12deb44

File tree

1 file changed

+32
-37
lines changed

1 file changed

+32
-37
lines changed

Dockerfile

Lines changed: 32 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -118,53 +118,48 @@ RUN wget \
118118
-O /tmp/busybox-1.36.1.tar.bz2 \
119119
https://busybox.net/downloads/busybox-1.36.1.tar.bz2
120120

121-
RUN tar -C /root/ -j -x -v -f /tmp/busybox-1.36.1.tar.bz2
122-
123121
################################################################################
124122
# BUSYBOX-ARM64 #
125123
################################################################################
126124
FROM platform AS busybox-arm64
127-
COPY --from=busybox-source /root/busybox-1.36.1 /root/busybox-1.36.1
128-
WORKDIR /root/busybox-1.36.1
129-
RUN mkdir /root/busybox/
130-
131-
RUN make \
132-
O=/root/busybox/ \
133-
CROSS_COMPILE=aarch64-linux-gnu- \
134-
CFLAGS="-march=armv8-a" \
135-
defconfig
136-
137-
RUN echo "CONFIG_STATIC=y" >> /root/busybox/.config
138-
RUN sed -i "s/CONFIG_TC=y/CONFIG_TC=n/g" /root/busybox/.config
139-
140-
RUN make \
141-
O=/root/busybox/ \
142-
CROSS_COMPILE=aarch64-linux-gnu- \
143-
CFLAGS="-march=armv8-a" \
144-
-j8 \
145-
install && \
146-
rm -rf /root/busybox-1.36.1
125+
COPY --from=busybox-source /tmp/busybox-1.36.1.tar.bz2 /tmp/busybox-1.36.1.tar.bz2
126+
RUN tar -C /root/ -j -x -v -f /tmp/busybox-1.36.1.tar.bz2 && \
127+
cd /root/busybox-1.36.1 && \
128+
mkdir /root/busybox/ && \
129+
make \
130+
O=/root/busybox/ \
131+
CROSS_COMPILE=aarch64-linux-gnu- \
132+
CFLAGS="-march=armv8-a" \
133+
defconfig && \
134+
echo "CONFIG_STATIC=y" >> /root/busybox/.config && \
135+
sed -i "s/CONFIG_TC=y/CONFIG_TC=n/g" /root/busybox/.config && \
136+
make \
137+
O=/root/busybox/ \
138+
CROSS_COMPILE=aarch64-linux-gnu- \
139+
CFLAGS="-march=armv8-a" \
140+
-j8 \
141+
install && \
142+
rm -rf /root/busybox-1.36.1
147143

148144
################################################################################
149145
# BUSYBOX-x64 #
150146
################################################################################
151147
FROM platform AS busybox-x64
152-
COPY --from=busybox-source /root/busybox-1.36.1 /root/busybox-1.36.1
153-
WORKDIR /root/busybox-1.36.1
154-
RUN mkdir /root/busybox/
155-
156-
RUN make \
157-
O=/root/busybox/ \
158-
defconfig
148+
COPY --from=busybox-source /tmp/busybox-1.36.1.tar.bz2 /tmp/busybox-1.36.1.tar.bz2
159149

160-
RUN echo "CONFIG_STATIC=y" >> /root/busybox/.config
161-
RUN sed -i "s/CONFIG_TC=y/CONFIG_TC=n/g" /root/busybox/.config
162-
163-
RUN make \
164-
O=/root/busybox/ \
165-
-j8 \
166-
install && \
167-
rm -rf /root/busybox-1.36.1
150+
RUN tar -C /root/ -j -x -v -f /tmp/busybox-1.36.1.tar.bz2 && \
151+
cd /root/busybox-1.36.1 && \
152+
mkdir /root/busybox/ && \
153+
make \
154+
O=/root/busybox/ \
155+
defconfig && \
156+
echo "CONFIG_STATIC=y" >> /root/busybox/.config && \
157+
sed -i "s/CONFIG_TC=y/CONFIG_TC=n/g" /root/busybox/.config && \
158+
make \
159+
O=/root/busybox/ \
160+
-j8 \
161+
install && \
162+
rm -rf /root/busybox-1.36.1
168163

169164
################################################################################
170165
# INITRD-BASE #

0 commit comments

Comments
 (0)