-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile_coreutils
29 lines (24 loc) · 946 Bytes
/
Dockerfile_coreutils
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
FROM middagj/kaniko-base
ARG gnu_mirror=https://ftp.snt.utwente.nl/pub/software/gnu
ARG coreutils_version=9.5
ARG coreutils_checksum=cd328edeac92f6a665de9f323c93b712af1858bc2e0d88f3f7100469470a1b8a
# Download
RUN curl -fsSL -o /tmp/coreutils.tar.xz "${gnu_mirror}/coreutils/coreutils-${coreutils_version}.tar.xz" \
&& sha256sum -c <<< "${coreutils_checksum} /tmp/coreutils.tar.xz" \
&& tar -xJf /tmp/coreutils.tar.xz \
&& mv coreutils-* coreutils \
&& rm -f /tmp/coreutils*
# Compile
RUN cd coreutils \
&& FORCE_UNSAFE_CONFIGURE=1 CC='musl-gcc' \
CFLAGS='-Os -ffunction-sections -fdata-sections' \
LDFLAGS='-Wl,--gc-sections' \
./configure --prefix=/busybox \
&& make
# Install
RUN cd coreutils && make install
# Clean /busybox
RUN while IFS= read -r file; do \
strip -s -R .comment -R .gnu.version --strip-unneeded "$file" ; \
done < <(find -- /busybox/bin -type f | sort) \
&& rm -rf /busybox/{libexec,share}