@@ -70,9 +70,20 @@ RUN curl -L https://codeload.github.com/NVIDIA/cuda-samples/tar.gz/refs/tags/v${
7070 make && \
7171 cp ${SAMPLE_NAME} /build/${SAMPLE_NAME}
7272
73+ # Build a static busybox layout: one binary plus applet symlinks (sh, rm,
74+ # ln, sleep, cat, ...) so PATH-resolved commands in init-container wrappers
75+ # and lifecycle hooks keep working on the non-*-dev* distroless base.
76+ FROM debian:trixie-slim AS shell
77+ RUN apt-get update \
78+ && apt-get install -y --no-install-recommends busybox-static \
79+ && rm -rf /var/lib/apt/lists/* \
80+ && mkdir /busybox \
81+ && cp /bin/busybox /busybox/busybox \
82+ && /busybox/busybox --install -s /busybox
83+
7384# The C/C++ distroless image is used as a base since the CUDA vectorAdd
7485# sample application depends on C/C++ libraries.
75- FROM nvcr.io/nvidia/distroless/cc:v4.0.6-dev
86+ FROM nvcr.io/nvidia/distroless/cc:v4.0.6
7687
7788ENV NVIDIA_VISIBLE_DEVICES=void
7889
@@ -89,6 +100,12 @@ LABEL description="See summary"
89100LABEL vsc-ref=${GIT_COMMIT}
90101
91102WORKDIR /
103+
104+ COPY --from=shell /busybox /busybox
105+ USER 0:0
106+ RUN ["/busybox/ln" , "-s" , "/busybox/sh" , "/bin/sh" ]
107+ ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/busybox
108+
92109COPY --from=builder /workspace/gpu-operator /usr/bin/
93110COPY --from=builder /workspace/manage-crds /usr/bin/
94111COPY --from=builder /workspace/nvidia-validator /usr/bin/
0 commit comments