FROM quay.io/pypa/manylinux_2_28_x86_64:2022-11-19-1b19e81

RUN dnf install -y kernel-devel kernel-headers
RUN curl https://developer.download.nvidia.com/compute/cuda/11.7.1/local_installers/cuda-repo-rhel8-11-7-local-11.7.1_515.65.01-1.x86_64.rpm -o cuda-repo-rhel8-11-7-local-11.7.1_515.65.01-1.x86_64.rpm
RUN rpm -i cuda-repo-rhel8-11-7-local-11.7.1_515.65.01-1.x86_64.rpm
RUN dnf clean all
RUN dnf install -y epel-release
RUN dnf update -y
RUN dnf -y module install nvidia-driver:latest-dkms
RUN dnf -y install cuda

FROM scratch
COPY --from=0 /usr/local/cuda-11.7/ /usr/local/cuda-11.7/
COPY --from=0 /usr/lib64/libcuda.so* /usr/lib64/
