-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add containerfile build to add nvidia
- Loading branch information
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
ARG COREOS_VERSION="${COREOS_VERSION:-stable}" | ||
ARG IMAGE_NAME="${IMAGE_NAME:-ucore}" | ||
ARG PR_PREFIX="${PR_PREFIX}" | ||
ARG ZFS_TAG="${ZFS_TAG}" | ||
|
||
FROM ghcr.io/ublue-os/${IMAGE_NAME}:${PR_PREFIX}${COREOS_VERSION}${ZFS_TAG} | ||
|
||
ARG COREOS_VERSION="${COREOS_VERSION:-stable}" | ||
ARG IMAGE_NAME="${IMAGE_NAME:-ucore}" | ||
ARG NVIDIA_MAJOR_VERSION="${NVIDIA_MAJOR_VERSION:-535}" | ||
|
||
ADD build.sh /tmp/build.sh | ||
|
||
COPY --from=ghcr.io/ublue-os/ucore-kmods:${COREOS_VERSION} /rpms/kmods/nvidia/ublue*.rpm /tmp/rpms/ | ||
COPY --from=ghcr.io/ublue-os/ucore-kmods:${COREOS_VERSION} /rpms/kmods/nvidia/${NVIDIA_MAJOR_VERSION} /tmp/rpms/ | ||
|
||
RUN mkdir -p /var/lib/alternatives \ | ||
&& /tmp/build.sh \ | ||
&& mv /var/lib/alternatives /staged-alternatives \ | ||
&& rm -fr /tmp/* /var/* \ | ||
&& rpm-ostree cleanup -m \ | ||
&& ostree container commit \ | ||
&& mkdir -p /var/lib && mv /staged-alternatives /var/lib/alternatives \ | ||
&& mkdir -p /tmp /var/tmp \ | ||
&& chmod -R 1777 /tmp /var/tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/sh | ||
|
||
set -ouex pipefail | ||
|
||
find /tmp/rpms | ||
|
||
rpm-ostree install /tmp/rpms/ublue-os-ucore-nvidia-*.rpm | ||
sed -i '0,/enabled=0/{s/enabled=0/enabled=1/}' /etc/yum.repos.d/nvidia-container-runtime.repo | ||
|
||
source /tmp/rpms/nvidia-vars | ||
|
||
rpm-ostree install \ | ||
xorg-x11-drv-${NVIDIA_PACKAGE_NAME}-{,cuda-,devel-,kmodsrc-,power-}${NVIDIA_FULL_VERSION} \ | ||
nvidia-container-toolkit \ | ||
/tmp/rpms/kmod-${NVIDIA_PACKAGE_NAME}-${KERNEL_VERSION}-${NVIDIA_AKMOD_VERSION}.fc${RELEASE}.rpm |