-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathDockerfile.musl.centos9
32 lines (24 loc) · 1.1 KB
/
Dockerfile.musl.centos9
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 alpine:3.20 AS build
ARG ARCH=x86
ENV ARCH=$ARCH
ARG LOCAL_KERNEL_VERSION=5.14.0-70.17.1.el9_0
ENV _LIBC=static
# hadolint ignore=DL3018
RUN apk add --no-cache -U build-base autoconf automake coreutils pkgconfig \
bc elfutils-dev openssl-dev clang clang-dev llvm \
rsync bison flex tar xz bash rpm ssl_client linux-headers
# hadolint ignore=DL3003,SC3009
RUN mkdir -p ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS} && \
echo "%_topdir %(echo $HOME)/rpmbuild" > ~/.rpmmacros && \
wget -q https://repo.almalinux.org/vault/9.0/BaseOS/Source/Packages/kernel-${LOCAL_KERNEL_VERSION}.src.rpm && \
rpm -i kernel-${LOCAL_KERNEL_VERSION}.src.rpm && \
cd ~/rpmbuild/SOURCES && \
tar -xf linux-${LOCAL_KERNEL_VERSION}.tar.xz && \
mkdir -p /usr/src/kernels && \
cd /usr/src && \
ln -s ~/rpmbuild/SOURCES/linux-${LOCAL_KERNEL_VERSION} linux && \
ln -s /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/include/stdarg.h /usr/src/linux/include/
WORKDIR /kernel-collector
COPY .dockerfiles/build.sh /build.sh
COPY . .
CMD ["/build.sh"]