Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
Signed-off-by: Charlie Drage <[email protected]>
  • Loading branch information
cdrage committed Nov 14, 2024
1 parent 80240d7 commit e3da808
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions bootc-nvidia-base-fedora/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,17 @@
# 1. In your OTHER Containerfile, change to `FROM git.k8s.land/cdrage/bootc-nvidia-base-fedora` / this Containerfile.
# 2. The nvidia drivers will recompile + use akmod + modprobe on boot.
# 3. Use nvidia-smi command within the booted container image to see if it works.
FROM quay.io/fedora/fedora-bootc:40
FROM quay.io/fedora/fedora-bootc:41


#! Install rpmfusion free and nonfree repo's for access to the nvidia drivers
RUN dnf install -y https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm && \
https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
RUN dnf install -y https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
RUN dnf install -y https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm

#! Install the kernel devel and kernel header tools
RUN dnf install -y kernel-devel kernel-headers
#! We get the kernel that is being used in THE BASE IMAGE by doing /usr/lib/modules && echo *, then we install the kernel-devel for that kernel
RUN export KVER=$(cd /usr/lib/modules && echo *) && \
dnf install -y kernel-devel-$KVER

#! Install the nvidia drivers
RUN dnf install -y akmod-nvidia xorg-x11-drv-nvidia-cuda
Expand All @@ -50,4 +53,4 @@ RUN echo "blacklist nouveau" > /etc/modprobe.d/blacklist_nouveau.conf
COPY usr/ /usr/

#! Enable necessary services to be started at boot
RUN systemctl enable nvidia-toolkit-firstboot.service nvidia-drivers.service
RUN systemctl enable nvidia-toolkit-firstboot.service nvidia-drivers.service

0 comments on commit e3da808

Please sign in to comment.