-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile_less
More file actions
32 lines (26 loc) · 975 Bytes
/
Dockerfile_less
File metadata and controls
32 lines (26 loc) · 975 Bytes
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
FROM middagj/kaniko-base
ARG gnu_mirror=https://ftp.snt.utwente.nl/pub/software/gnu
ARG less_version=668
# Download
RUN curl -fsSL -o /tmp/less.tar.gz "${gnu_mirror}/less/less-${less_version}.tar.gz" \
&& curl -fsSL -o /tmp/less.tar.gz.sig "${gnu_mirror}/less/less-${less_version}.tar.gz.sig" \
&& gpgv --keyring gnu-keyring.gpg /tmp/less.tar.gz.sig /tmp/less.tar.gz \
&& tar -xzf /tmp/less.tar.gz \
&& mv less-* less \
&& rm -f /tmp/less*
# Add libraries
COPY --from=middagj/kaniko-ncurses /root/include /root/deps/include
COPY --from=middagj/kaniko-ncurses /root/lib /root/deps/lib
# Compile
RUN cd less \
&& CC='musl-gcc' \
CFLAGS="-Os -ffunction-sections -fdata-sections -I$HOME/deps/include" \
LDFLAGS="-Wl,--gc-sections -static -L$HOME/deps/lib" \
./configure \
&& make
# Install
RUN mv less/less /busybox/bin/
# Clean /busybox
RUN for file in /busybox/bin/*; do \
strip -s -R .comment -R .gnu.version --strip-unneeded $file ; \
done