-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile_bash
33 lines (27 loc) · 1.03 KB
/
Dockerfile_bash
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
30
31
32
33
FROM middagj/kaniko-base
ARG gnu_mirror=https://ftp.snt.utwente.nl/pub/software/gnu
ARG bash_version=5.2.37
# Download public key
RUN gpg --batch --keyserver keyserver.ubuntu.com --recv-keys '7C0135FB088AAF6C66C650B9BB5869F064EA74AB' \
&& gpg --import-ownertrust <<< '7C0135FB088AAF6C66C650B9BB5869F064EA74AB:6:'
# Download
RUN curl -fsSL -o /tmp/bash.tar.gz "${gnu_mirror}/bash/bash-${bash_version}.tar.gz" \
&& curl -fsSL -o /tmp/bash.tar.gz.sig "${gnu_mirror}/bash/bash-${bash_version}.tar.gz.sig" \
&& gpg --verify /tmp/bash.tar.gz.sig \
&& tar -xzf /tmp/bash.tar.gz \
&& mv bash* bash \
&& rm -f /tmp/bash*
# Compile
RUN cd bash \
&& FORCE_UNSAFE_CONFIGURE=1 \
CC='musl-gcc' \
CFLAGS='-Os -ffunction-sections -fdata-sections' \
LDFLAGS='-Wl,--gc-sections' \
./configure --without-bash-malloc \
&& make bash
# Install
RUN mv bash/bash /busybox/bin
# 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)