diff --git a/Makefile b/Makefile index ab00a877..4a269446 100644 --- a/Makefile +++ b/Makefile @@ -166,6 +166,7 @@ $(DRIVER_BUILD_TARGETS): --build-arg DRIVER_BRANCH="$(DRIVER_BRANCH)" \ --build-arg CUDA_VERSION="$(CUDA_VERSION)" \ --build-arg CVE_UPDATES="$(CVE_UPDATES)" \ + --build-arg GIT_COMMIT="$(GIT_COMMIT)" \ $(DOCKER_BUILD_ARGS) \ --file $(DOCKERFILE) \ $(CURDIR)/$(SUBDIR) diff --git a/rhel8/Dockerfile b/rhel8/Dockerfile index d52b1810..3eb7c486 100644 --- a/rhel8/Dockerfile +++ b/rhel8/Dockerfile @@ -34,6 +34,7 @@ ARG DRIVER_VERSION ENV DRIVER_VERSION=$DRIVER_VERSION ARG DRIVER_BRANCH ENV DRIVER_BRANCH=$DRIVER_BRANCH +ARG GIT_COMMIT # Arg to indicate if driver type is either of passthrough/baremetal or vgpu ARG DRIVER_TYPE=passthrough @@ -102,6 +103,7 @@ LABEL io.k8s.display-name="NVIDIA Driver Container" LABEL name="NVIDIA Driver Container" LABEL vendor="NVIDIA" LABEL version="${DRIVER_VERSION}" +LABEL com.nvidia.git-commit="${GIT_COMMIT}" LABEL release="N/A" LABEL summary="Provision the NVIDIA driver through containers" LABEL description="See summary" diff --git a/rhel9/Dockerfile b/rhel9/Dockerfile index 0cc92794..85031769 100644 --- a/rhel9/Dockerfile +++ b/rhel9/Dockerfile @@ -34,6 +34,7 @@ ARG DRIVER_VERSION ENV DRIVER_VERSION=$DRIVER_VERSION ARG DRIVER_BRANCH ENV DRIVER_BRANCH=$DRIVER_BRANCH +ARG GIT_COMMIT # Arg to indicate if driver type is either of passthrough/baremetal or vgpu ARG DRIVER_TYPE=passthrough @@ -96,6 +97,7 @@ LABEL io.k8s.display-name="NVIDIA Driver Container" LABEL name="NVIDIA Driver Container" LABEL vendor="NVIDIA" LABEL version="${DRIVER_VERSION}" +LABEL com.nvidia.git-commit="${GIT_COMMIT}" LABEL release="N/A" LABEL summary="Provision the NVIDIA driver through containers" LABEL description="See summary" diff --git a/ubuntu20.04/Dockerfile b/ubuntu20.04/Dockerfile index a5d0feff..f58f5f8b 100644 --- a/ubuntu20.04/Dockerfile +++ b/ubuntu20.04/Dockerfile @@ -42,6 +42,7 @@ ENV TARGETARCH=$TARGETARCH ARG DRIVER_VERSION ENV DRIVER_VERSION=$DRIVER_VERSION ENV DEBIAN_FRONTEND=noninteractive +ARG GIT_COMMIT # Arg to indicate if driver type is either of passthrough(baremetal) or vgpu ARG DRIVER_TYPE=passthrough @@ -105,4 +106,13 @@ RUN rm /etc/apt/sources.list.d/cuda.list # Add NGC DL license from the CUDA image RUN mkdir /licenses && mv /NGC-DL-CONTAINER-LICENSE /licenses/NGC-DL-CONTAINER-LICENSE +LABEL io.k8s.display-name="NVIDIA Driver Container" +LABEL name="NVIDIA Driver Container" +LABEL vendor="NVIDIA" +LABEL version="${DRIVER_VERSION}" +LABEL com.nvidia.git-commit="${GIT_COMMIT}" +LABEL release="N/A" +LABEL summary="Provision the NVIDIA driver through containers" +LABEL description="See summary" + ENTRYPOINT ["nvidia-driver", "init"] diff --git a/ubuntu22.04/Dockerfile b/ubuntu22.04/Dockerfile index 16052497..48425c81 100644 --- a/ubuntu22.04/Dockerfile +++ b/ubuntu22.04/Dockerfile @@ -42,6 +42,7 @@ ENV TARGETARCH=$TARGETARCH ARG DRIVER_VERSION ENV DRIVER_VERSION=$DRIVER_VERSION ENV DEBIAN_FRONTEND=noninteractive +ARG GIT_COMMIT # Arg to indicate if driver type is either of passthrough(baremetal) or vgpu ARG DRIVER_TYPE=passthrough @@ -118,4 +119,13 @@ RUN rm -f /etc/apt/sources.list.d/cuda* # Add NGC DL license from the CUDA image RUN mkdir /licenses && mv /NGC-DL-CONTAINER-LICENSE /licenses/NGC-DL-CONTAINER-LICENSE +LABEL io.k8s.display-name="NVIDIA Driver Container" +LABEL name="NVIDIA Driver Container" +LABEL vendor="NVIDIA" +LABEL version="${DRIVER_VERSION}" +LABEL com.nvidia.git-commit="${GIT_COMMIT}" +LABEL release="N/A" +LABEL summary="Provision the NVIDIA driver through containers" +LABEL description="See summary" + ENTRYPOINT ["nvidia-driver", "init"] diff --git a/ubuntu22.04/precompiled/Dockerfile b/ubuntu22.04/precompiled/Dockerfile index 3c159dc3..c2821a24 100644 --- a/ubuntu22.04/precompiled/Dockerfile +++ b/ubuntu22.04/precompiled/Dockerfile @@ -10,6 +10,8 @@ ENV DRIVER_VERSION=$DRIVER_VERSION ARG KERNEL_VERSION=5.15.0-116-generic ENV KERNEL_VERSION=$KERNEL_VERSION +ARG GIT_COMMIT + ENV NVIDIA_VISIBLE_DEVICES=void RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections @@ -68,4 +70,13 @@ WORKDIR /drivers # Remove cuda repository to avoid GPG errors RUN rm -f /etc/apt/sources.list.d/cuda* +LABEL io.k8s.display-name="NVIDIA Driver Container" +LABEL name="NVIDIA Driver Container" +LABEL vendor="NVIDIA" +LABEL version="${DRIVER_BRANCH}-${KERNEL_VERSION}" +LABEL com.nvidia.git-commit="${GIT_COMMIT}" +LABEL release="N/A" +LABEL summary="Provision the NVIDIA driver through containers" +LABEL description="See summary" + ENTRYPOINT ["nvidia-driver", "init"] diff --git a/ubuntu24.04/Dockerfile b/ubuntu24.04/Dockerfile index fd183458..08f4f2b4 100644 --- a/ubuntu24.04/Dockerfile +++ b/ubuntu24.04/Dockerfile @@ -42,6 +42,7 @@ ARG BASE_URL=https://us.download.nvidia.com/tesla ARG TARGETARCH ENV TARGETARCH=$TARGETARCH ARG DRIVER_VERSION +ARG GIT_COMMIT ENV DRIVER_VERSION=$DRIVER_VERSION ENV DEBIAN_FRONTEND=noninteractive @@ -104,4 +105,13 @@ RUN rm -f /etc/apt/sources.list.d/cuda* # Add NGC DL license from the CUDA image RUN mkdir /licenses && mv /NGC-DL-CONTAINER-LICENSE /licenses/NGC-DL-CONTAINER-LICENSE +LABEL io.k8s.display-name="NVIDIA Driver Container" +LABEL name="NVIDIA Driver Container" +LABEL vendor="NVIDIA" +LABEL version="${DRIVER_VERSION}" +LABEL com.nvidia.git-commit="${GIT_COMMIT}" +LABEL release="N/A" +LABEL summary="Provision the NVIDIA driver through containers" +LABEL description="See summary" + ENTRYPOINT ["nvidia-driver", "init"] diff --git a/ubuntu24.04/precompiled/Dockerfile b/ubuntu24.04/precompiled/Dockerfile index 5d255c95..85c9e2ca 100644 --- a/ubuntu24.04/precompiled/Dockerfile +++ b/ubuntu24.04/precompiled/Dockerfile @@ -10,6 +10,8 @@ ENV DRIVER_VERSION=$DRIVER_VERSION ARG KERNEL_VERSION=6.8.0-44-generic ENV KERNEL_VERSION=$KERNEL_VERSION +ARG GIT_COMMIT + ENV NVIDIA_VISIBLE_DEVICES=void RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections @@ -63,4 +65,13 @@ WORKDIR /drivers # Remove cuda repository to avoid GPG errors RUN rm -f /etc/apt/sources.list.d/cuda* +LABEL io.k8s.display-name="NVIDIA Driver Container" +LABEL name="NVIDIA Driver Container" +LABEL vendor="NVIDIA" +LABEL version="${DRIVER_BRANCH}-${KERNEL_VERSION}" +LABEL com.nvidia.git-commit="${GIT_COMMIT}" +LABEL release="N/A" +LABEL summary="Provision the NVIDIA driver through containers" +LABEL description="See summary" + ENTRYPOINT ["nvidia-driver", "init"] diff --git a/versions.mk b/versions.mk index c26fe6a0..4d4c4f98 100644 --- a/versions.mk +++ b/versions.mk @@ -16,3 +16,5 @@ DRIVER_VERSIONS ?= 535.230.02 550.144.03 570.124.06 GOLANG_VERSION := 1.23.6 + +GIT_COMMIT ?= $(shell git describe --match="" --dirty --long --always --abbrev=40 2> /dev/null || echo "")