@@ -48,14 +48,18 @@ ARG VERSION="N/A"
4848ARG GIT_COMMIT="unknown"
4949RUN make PREFIX=/artifacts/bin cmd-nvidia-ctk-installer
5050
51- # The packaging stage collects the deb and rpm packages built for supported
52- # architectures.
53- FROM nvcr.io/nvidia/cuda:12.9.0-base-ubi9 AS packaging
51+ # The packaging stage collects the deb and rpm packages built for
52+ # supported architectures.
53+ FROM nvcr.io/nvidia/distroless/go:v3.1.9-dev AS packaging
54+
55+ USER 0:0
56+ SHELL ["/busybox/sh" , "-c" ]
57+ RUN ln -s /busybox/sh /bin/sh
5458
5559ARG ARTIFACTS_ROOT
5660COPY ${ARTIFACTS_ROOT} /artifacts/packages/
5761
58- WORKDIR /artifacts/packages
62+ WORKDIR /artifacts
5963
6064# build-args are added to the manifest.txt file below.
6165ARG PACKAGE_VERSION
@@ -70,7 +74,14 @@ RUN echo "#IMAGE_EPOCH=$(date '+%s')" > /artifacts/manifest.txt && \
7074 env | sed 's/^/#/g' >> /artifacts/manifest.txt && \
7175 find /artifacts/packages -iname '*.deb' -o -iname '*.rpm' >> /artifacts/manifest.txt
7276
73- RUN mkdir /licenses && mv /NGC-DL-CONTAINER-LICENSE /licenses/NGC-DL-CONTAINER-LICENSE
77+ LABEL name="NVIDIA Container Toolkit Packages"
78+ LABEL vendor="NVIDIA"
79+ LABEL version="${VERSION}"
80+ LABEL release="N/A"
81+ LABEL summary="deb and rpm packages for the NVIDIA Container Toolkit"
82+ LABEL description="See summary"
83+
84+ COPY LICENSE /licenses/
7485
7586# The debpackages stage is used to extract the contents of deb packages.
7687FROM nvcr.io/nvidia/cuda:12.9.0-base-ubuntu20.04 AS debpackages
@@ -116,13 +127,19 @@ RUN set -eux; \
116127# - The extracted deb packages
117128# - The extracted rpm packages
118129# - The nvidia-ctk-installer binary
119- FROM nvcr.io/nvidia/cuda:12.9.0-base-ubi9 AS artifacts
130+ FROM scratch AS artifacts
120131
121132COPY --from=rpmpackages /artifacts/rpm /artifacts/rpm
122133COPY --from=debpackages /artifacts/deb /artifacts/deb
123134COPY --from=build /artifacts/bin /artifacts/build
124135
125- FROM nvcr.io/nvidia/cuda:12.9.0-base-ubi9
136+ # The application stage contains the application used as a GPU Operator
137+ # operand.
138+ FROM nvcr.io/nvidia/distroless/go:v3.1.9-dev AS application
139+
140+ USER 0:0
141+ SHELL ["/busybox/sh" , "-c" ]
142+ RUN ln -s /busybox/sh /bin/sh
126143
127144ENV NVIDIA_DISABLE_REQUIRE="true"
128145ENV NVIDIA_VISIBLE_DEVICES=void
@@ -144,6 +161,11 @@ LABEL release="N/A"
144161LABEL summary="Automatically Configure your Container Runtime for GPU support."
145162LABEL description="See summary"
146163
147- RUN mkdir /licenses && mv /NGC-DL-CONTAINER- LICENSE /licenses/NGC-DL-CONTAINER-LICENSE
164+ COPY LICENSE /licenses/
148165
149166ENTRYPOINT ["/work/nvidia-ctk-installer" ]
167+
168+ # The GPU Operator exec's nvidia-toolkit in its entrypoint.
169+ # We create a symlink here to ensure compatibility with older
170+ # GPU Operator versions.
171+ RUN ln -s /work/nvidia-ctk-installer /work/nvidia-toolkit
0 commit comments