Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions Dockerfile468
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
FROM registry.access.redhat.com/ubi8/ubi:8.2

COPY <updatewithlocalfile>.pem /etc/pki/entitlement/

COPY <updatewithlocalfile>-key.pem /etc/pki/entitlement/

COPY rhsm.conf /etc/rhsm/

RUN rm -f /etc/yum.repos.d/ubi.repo

COPY redhat.repo /etc/yum.repos.d/

ARG DRIVER_VERSION
ENV DRIVER_VERSION=${DRIVER_VERSION:-440.64.00}

ARG BASE_URL
ENV BASE_URL=${BASE_URL:-https://us.download.nvidia.com/tesla}

ARG PUBLIC_KEY
ENV PUBLIC_KEY=${PUBLIC_KEY:-empty}

ARG PRIVATE_KEY

ARG KERNEL_VERSION
ENV KERNEL_VERSION=${KERNEL_VERSION:-4.18.0-147.3.1.el8_1.x86_64}


COPY nvidia-driver-disconnected /usr/local/bin/nvidia-driver-disconnected

RUN dnf install --releasever=8.2 --setopt tsflags=nodocs -y ca-certificates curl gcc glibc.i686 make cpio kmod \
elfutils-libelf elfutils-libelf-devel \
"kernel-headers-${KERNEL_VERSION}" "kernel-devel-${KERNEL_VERSION}" \
&& rm -rf /var/cache/yum/*

RUN curl -fsSL -o /usr/local/bin/donkey https://github.com/3XX0/donkey/releases/download/v1.1.0/donkey \
&& curl -fsSL -o /usr/local/bin/extract-vmlinux https://raw.githubusercontent.com/torvalds/linux/master/scripts/extract-vmlinux \
&& chmod +x /usr/local/bin/donkey /usr/local/bin/extract-vmlinux

RUN ln -s /sbin/ldconfig /sbin/ldconfig.real \
&& chmod +x /usr/local/bin/nvidia-driver-disconnected \
&& ln -sf /usr/local/bin/nvidia-driver-disconnected /usr/local/bin/nvidia-driver

RUN cd /tmp \
&& curl -fSsl -O $BASE_URL/$DRIVER_VERSION/NVIDIA-Linux-x86_64-$DRIVER_VERSION.run \
&& sh NVIDIA-Linux-x86_64-$DRIVER_VERSION.run -x \
&& cd NVIDIA-Linux-x86_64-$DRIVER_VERSION \
&& ./nvidia-installer --silent --no-kernel-module --install-compat32-libs --no-nouveau-check --no-nvidia-modprobe \
--no-rpms --no-backup --no-check-for-alternate-installs --no-libglx-indirect --no-install-libglvnd --x-prefix=/tmp/null \
--x-module-path=/tmp/null --x-library-path=/tmp/null --x-sysconfig-path=/tmp/null \
&& mkdir -p /usr/src/nvidia-$DRIVER_VERSION \
&& mv LICENSE mkprecompiled kernel /usr/src/nvidia-$DRIVER_VERSION \
&& sed '9,${/^\(kernel\|LICENSE\)/!d}' .manifest > /usr/src/nvidia-$DRIVER_VERSION/.manifest \
&& rm -rf /tmp/* \
&& dnf --releasever=8.2 download -y kernel-core-${KERNEL_VERSION} --downloaddir=/tmp/ \
&& rm -rf /var/cache/yum

WORKDIR /usr/src/nvidia-$DRIVER_VERSION

COPY ${PUBLIC_KEY} kernel/pubkey.x509

RUN mkdir -p /run/nvidia \
&& touch /run/nvidia/nvidia-driver.pid

# This will really run the disconnected version
ENTRYPOINT ["nvidia-driver","init"]

24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,27 @@ Note: The container cannot be built in an air-gapped / disconnected environment.
| 4.5.6-x86_64 | 4.18.0-193.14.3.el8_2.x86_64 |
| 4.6.1-x86_64 | 4.18.0-193.24.1.el8_2.dt1.x86_64 |
| 4.6.8-x86_64 | 4.18.0-193.29.1.el8_2.x86_64 |

## Note the following for kernel of 4.6.8

1. you need to have the following repositories enabled on your RHEL 8.2 system

```
rhel-8-for-x86_64-baseos-eus-rpms
rhel-8-for-x86_64-baseos-rpms
rhocp-4.6-for-rhel-8-x86_64-rpms
rhel-8-for-x86_64-appstream-rpms
```

2. Set the release to 8.2
```
subscription-manager release --set=8.2
```
3. Copy the following files to this directory
```
/etc/pki/entitlement/<>.pem and <>-key.pem files
/etc/yum.repos.d/redhat.repo
/etc/rhsm/rhsm.conf
```

4. Update the Dockerfile468 with the files you copied in last step and run using this file