-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile_base
44 lines (33 loc) · 1.56 KB
/
Dockerfile_base
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
34
35
36
37
38
39
40
41
42
43
44
FROM debian:bookworm-slim
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends \
automake build-essential ca-certificates curl gettext gnupg less lzip vim pkg-config xz-utils
WORKDIR /root
RUN mkdir -p /busybox/{bin,lib}
ARG musl_version=1.2.5
ARG musl_pubkey_checksum=bf6baaa63c2c4958636850a24bb9d2d514c8b6a1b3ab9c08f3b75910fb6f57be
ARG gnu_mirror=https://ftp.snt.utwente.nl/pub/software/gnu
ARG gnu_keyring_checksum=c72adb7f24fbab0a1e1a8062b715bd47f66754cd9bad6d098101bd4755adc46e
# Download public keys
RUN curl -fsSL -o /tmp/musl.pub 'https://musl.libc.org/musl.pub' \
&& sha256sum -c <<< "${musl_pubkey_checksum} /tmp/musl.pub" \
&& gpg --keyring musl.kbx --no-default-keyring --import /tmp/musl.pub \
&& rm /tmp/musl.pub .gnupg/*.kbx~
RUN curl -fsSL -o .gnupg/gnu-keyring.gpg "${gnu_mirror}/gnu-keyring.gpg" \
&& sha256sum -c <<< "${gnu_keyring_checksum} .gnupg/gnu-keyring.gpg"
# Download
RUN curl -fsSL -o /tmp/musl.tar.gz "https://musl.libc.org/releases/musl-${musl_version}.tar.gz" \
&& curl -fsSL -o /tmp/musl.tar.gz.asc "https://musl.libc.org/releases/musl-${musl_version}.tar.gz.asc" \
&& gpgv --keyring musl.kbx /tmp/musl.tar.gz.asc /tmp/musl.tar.gz \
&& tar -xzf /tmp/musl.tar.gz \
&& mv musl-* musl \
&& rm -f /tmp/musl*
# Compile
RUN cd musl \
&& CFLAGS='-Os' ./configure --syslibdir=/busybox/lib \
&& make
# Install
RUN cd musl && make install \
&& for lib in /busybox/lib/*; do ln -f $(readlink $lib) $lib; done
ENV PATH="/usr/local/musl/bin:$PATH"