Skip to content

Commit 4ceccd5

Browse files
Ship static busybox shell in k8s-device-plugin image
Flip the base from *-dev* to non-*-dev* distroless and source a static busybox from debian:trixie-slim. The device-plugin entrypoint and any shell-based lifecycle hooks continue to work via /bin/sh and busybox applet symlinks layered into the final image. Part of NVIDIA/cloud-native-team#299. Signed-off-by: Rajath Agasthya <ragasthya@nvidia.com>
1 parent c0a073e commit 4ceccd5

1 file changed

Lines changed: 16 additions & 3 deletions

File tree

deployments/container/Dockerfile

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,24 @@ ARG VERSION="N/A"
4040
ARG GIT_COMMIT="unknown"
4141
RUN make PREFIX=/artifacts cmds
4242

43-
FROM nvcr.io/nvidia/distroless/go:v4.0.6-dev AS application
43+
# Build a static busybox layout: one binary plus applet symlinks (sh, rm,
44+
# ln, sleep, cat, ...) so PATH-resolved commands in init-container wrappers
45+
# and lifecycle hooks keep working on the non-*-dev* distroless base.
46+
FROM debian:trixie-slim AS shell
47+
RUN apt-get update \
48+
&& apt-get install -y --no-install-recommends busybox-static \
49+
&& rm -rf /var/lib/apt/lists/* \
50+
&& mkdir /busybox \
51+
&& cp /bin/busybox /busybox/busybox \
52+
&& /busybox/busybox --install -s /busybox
53+
54+
FROM nvcr.io/nvidia/distroless/go:v4.0.6 AS application
4455

4556
USER 0:0
46-
SHELL ["/busybox/sh", "-c"]
47-
RUN ln -s /busybox/sh /bin/sh
57+
58+
COPY --from=shell /busybox /busybox
59+
RUN ["/busybox/ln", "-s", "/busybox/sh", "/bin/sh"]
60+
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/busybox
4861

4962
ENV NVIDIA_DISABLE_REQUIRE="true"
5063
ENV NVIDIA_VISIBLE_DEVICES=all

0 commit comments

Comments
 (0)