-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathContainerfile.fedora-kmods
35 lines (28 loc) · 1.54 KB
/
Containerfile.fedora-kmods
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
ARG FEDORA_VERSION=${FEDORA_VERSION:-40}
FROM quay.io/fedora/fedora-minimal:${FEDORA_VERSION} AS build
ARG FEDORA_VERSION
RUN echo "Prepare for build..." && \
ln -s /usr/bin/dnf5 /usr/bin/dnf && \
sed -i /etc/yum.repos.d/fedora-cisco-openh264.repo -re '/^\[fedora-cisco-openh264\]$/,/^$/{s/enabled=1/enabled=0/}' && \
sed -i /etc/yum.repos.d/fedora-updates-testing.repo -re '/^\[updates-testing\]$/,/^$/{s/enabled=1/enabled=0/}' && \
mkdir -p /rpms && mkdir -p /var/lib/alternatives && \
dnf install -y distribution-gpg-keys && \
dnf install -y \
https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-${FEDORA_VERSION}.noarch.rpm \
https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm \
&& \
dnf --setopt=install_weak_deps=false install -y kernel kernel-devel && \
dnf install -y rpmfusion-nonfree-release-rawhide && \
dnf upgrade -y && \
echo "...done!"
RUN echo "Install akmods..." && \
dnf --no-gpgchecks --setopt=install_weak_deps=false install -y akmod-v4l2loopback && \
sleep 3 && \
dnf --no-gpgchecks --setopt=install_weak_deps=false --enablerepo=rpmfusion-nonfree-rawhide install -y akmod-nvidia && \
echo "...done!"
RUN echo "Build kmods..." && \
akmods --force --kernels "$(rpm -q kernel --queryformat '%{VERSION}-%{RELEASE}.%{ARCH}')" && \
find /var/cache/akmods -type f -name '*.rpm' -exec cp {} /rpms/ \; && \
echo "...done!"
FROM scratch
COPY --from=build /rpms /rpms