-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: split nvidia akmods into distinct images (#54)
In order to make both build time and minimize excess space used by consumers of akmods images, it is helpful to split the nvidia drivers each into their own distinct image. The original `akmods` image returns to its very small (currently 1.7MB) size, and the new `akmods-nvidia` images will each be only the size of their respective kmod.
- Loading branch information
Showing
5 changed files
with
75 additions
and
32 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
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
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,46 @@ | ||
### | ||
### Containerfile.nvidia - used to build ONLY NVIDIA kmods (one driver version per build) | ||
### | ||
|
||
#Build from base, simpley because it's the smallest image | ||
ARG SOURCE_IMAGE="${SOURCE_IMAGE:-base}" | ||
ARG BASE_IMAGE="quay.io/fedora-ostree-desktops/${SOURCE_IMAGE}" | ||
ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION:-37}" | ||
|
||
FROM ${BASE_IMAGE}:${FEDORA_MAJOR_VERSION} AS builder | ||
ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION:-37}" | ||
ARG NVIDIA_MAJOR_VERSION="${NVIDIA_MAJOR_VERSION:-470}" | ||
|
||
COPY build*.sh /tmp | ||
COPY certs /tmp/certs | ||
|
||
# files for nvidia | ||
COPY ublue-os-nvidia-addons.spec /tmp/ublue-os-nvidia-addons/ublue-os-nvidia-addons.spec | ||
ADD https://nvidia.github.io/nvidia-docker/rhel9.0/nvidia-docker.repo \ | ||
/tmp/ublue-os-nvidia-addons/rpmbuild/SOURCES/nvidia-container-runtime.repo | ||
ADD https://copr.fedorainfracloud.org/coprs/eyecantcu/supergfxctl/repo/fedora-${FEDORA_MAJOR_VERSION}/eyecantcu-supergfxctl-fedora-${FEDORA_MAJOR_VERSION}.repo \ | ||
/tmp/ublue-os-nvidia-addons/rpmbuild/SOURCES/eyecantcu-supergfxctl.repo | ||
ADD files/etc/nvidia-container-runtime/config-rootless.toml \ | ||
/tmp/ublue-os-nvidia-addons/rpmbuild/SOURCES/config-rootless.toml | ||
ADD https://raw.githubusercontent.com/NVIDIA/dgx-selinux/master/bin/RHEL9/nvidia-container.pp \ | ||
/tmp/ublue-os-nvidia-addons/rpmbuild/SOURCES/nvidia-container.pp | ||
ADD files/etc/sway/environment /tmp/ublue-os-nvidia-addons/rpmbuild/SOURCES/environment | ||
|
||
|
||
RUN /tmp/build-prep.sh | ||
|
||
RUN /tmp/build-ublue-os-nvidia-addons.sh | ||
|
||
RUN /tmp/build-kmod-nvidia.sh ${NVIDIA_MAJOR_VERSION} | ||
|
||
RUN cp /tmp/ublue-os-nvidia-addons/rpmbuild/RPMS/noarch/ublue-os-nvidia-addons*.rpm \ | ||
/var/cache/rpms/ublue-os/ | ||
RUN for RPM in $(find /var/cache/akmods/ -type f -name \*.rpm); do \ | ||
cp "${RPM}" /var/cache/rpms/kmods/; \ | ||
done | ||
|
||
RUN find /var/cache/rpms | ||
|
||
FROM scratch | ||
|
||
COPY --from=builder /var/cache/rpms /rpms |
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
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