@@ -48,14 +48,18 @@ ARG VERSION="N/A"
48
48
ARG GIT_COMMIT="unknown"
49
49
RUN make PREFIX=/artifacts/bin cmd-nvidia-ctk-installer
50
50
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
54
58
55
59
ARG ARTIFACTS_ROOT
56
60
COPY ${ARTIFACTS_ROOT} /artifacts/packages/
57
61
58
- WORKDIR /artifacts/packages
62
+ WORKDIR /artifacts
59
63
60
64
# build-args are added to the manifest.txt file below.
61
65
ARG PACKAGE_VERSION
@@ -70,7 +74,14 @@ RUN echo "#IMAGE_EPOCH=$(date '+%s')" > /artifacts/manifest.txt && \
70
74
env | sed 's/^/#/g' >> /artifacts/manifest.txt && \
71
75
find /artifacts/packages -iname '*.deb' -o -iname '*.rpm' >> /artifacts/manifest.txt
72
76
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/
74
85
75
86
# The debpackages stage is used to extract the contents of deb packages.
76
87
FROM nvcr.io/nvidia/cuda:12.9.0-base-ubuntu20.04 AS debpackages
@@ -116,13 +127,19 @@ RUN set -eux; \
116
127
# - The extracted deb packages
117
128
# - The extracted rpm packages
118
129
# - The nvidia-ctk-installer binary
119
- FROM nvcr.io/nvidia/cuda:12.9.0-base-ubi9 AS artifacts
130
+ FROM scratch AS artifacts
120
131
121
132
COPY --from=rpmpackages /artifacts/rpm /artifacts/rpm
122
133
COPY --from=debpackages /artifacts/deb /artifacts/deb
123
134
COPY --from=build /artifacts/bin /artifacts/build
124
135
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
126
143
127
144
ENV NVIDIA_DISABLE_REQUIRE="true"
128
145
ENV NVIDIA_VISIBLE_DEVICES=void
@@ -144,6 +161,11 @@ LABEL release="N/A"
144
161
LABEL summary="Automatically Configure your Container Runtime for GPU support."
145
162
LABEL description="See summary"
146
163
147
- RUN mkdir /licenses && mv /NGC-DL-CONTAINER- LICENSE /licenses/NGC-DL-CONTAINER-LICENSE
164
+ COPY LICENSE /licenses/
148
165
149
166
ENTRYPOINT ["/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