@@ -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,12 @@ 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"
7483
7584# The debpackages stage is used to extract the contents of deb packages.
7685FROM nvcr.io/nvidia/cuda:12.9.0-base-ubuntu20.04 AS debpackages
@@ -116,13 +125,19 @@ RUN set -eux; \
116125# - The extracted deb packages
117126# - The extracted rpm packages
118127# - The nvidia-ctk-installer binary
119- FROM nvcr.io/nvidia/cuda:12.9.0-base-ubi9 AS artifacts
128+ FROM scratch AS artifacts
120129
121130COPY --from=rpmpackages /artifacts/rpm /artifacts/rpm
122131COPY --from=debpackages /artifacts/deb /artifacts/deb
123132COPY --from=build /artifacts/bin /artifacts/build
124133
125- FROM nvcr.io/nvidia/cuda:12.9.0-base-ubi9
134+ # The application stage contains the application used as a GPU Operator
135+ # operand.
136+ FROM nvcr.io/nvidia/distroless/go:v3.1.9-dev AS application
137+
138+ USER 0:0
139+ SHELL ["/busybox/sh" , "-c" ]
140+ RUN ln -s /busybox/sh /bin/sh
126141
127142ENV NVIDIA_DISABLE_REQUIRE="true"
128143ENV NVIDIA_VISIBLE_DEVICES=void
@@ -131,6 +146,7 @@ ENV NVIDIA_DRIVER_CAPABILITIES=utility
131146COPY --from=artifacts /artifacts/rpm /artifacts/rpm
132147COPY --from=artifacts /artifacts/deb /artifacts/deb
133148COPY --from=artifacts /artifacts/build /work
149+ COPY --from=artifacts /NGC-DL-CONTAINER-LICENSE /licenses/NGC-DL-CONTAINER-LICENSE
134150
135151WORKDIR /work
136152ENV PATH=/work:$PATH
@@ -144,6 +160,4 @@ LABEL release="N/A"
144160LABEL summary="Automatically Configure your Container Runtime for GPU support."
145161LABEL description="See summary"
146162
147- RUN mkdir /licenses && mv /NGC-DL-CONTAINER-LICENSE /licenses/NGC-DL-CONTAINER-LICENSE
148-
149163ENTRYPOINT ["/work/nvidia-ctk-installer" ]
0 commit comments