forked from kmods-via-containers/kvc-simple-kmod
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.rhel
22 lines (17 loc) · 933 Bytes
/
Dockerfile.rhel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
FROM registry.access.redhat.com/ubi8:latest
MAINTAINER "coreos@lists.fedoraproject.org"
WORKDIR /build/
# pull in the repo config
ADD auristor.repo /build/
# Expecting kmod software version as an input to the build
ARG KMODVER
# Expecting kernel version as an input to the build
ARG KVER
# Set dnf vars
RUN echo $KMODVER > /etc/dnf/vars/auristorver
# First update the base container to latest versions of everything
RUN dnf update -y
# Put cpio and modinfo in the base container
RUN dnf install -y cpio kmod
# Grab the kmod from upstream and extract it
RUN export ARCH=`uname -m` && export KERN=`echo $KVER |sed s/-/_/g|sed s/.$ARCH//` && export RPMVERS=`dnf -c auristor.repo list kmod-yfs --showduplicates |grep $KERN |awk '{print $2}'|sort -r|head -1` && dnf -c auristor.repo download kmod-yfs-${RPMVERS} && rpm2cpio kmod-yfs-${RPMVERS}.${ARCH}.rpm |(cd / && cpio -id \*.ko) && rm kmod-yfs-${RPMVERS}.${ARCH}.rpm && depmod -a