Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions deployments/container/Dockerfile.distroless
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

ARG GFD_IMAGE=nvcr.io/nvidia/k8s-device-plugin:v0.19.0
ARG BUILDER_IMAGE=nvcr.io/nvidia/cuda:13.2.0-base-ubi9
ARG DISTROLESS_BASE_IMAGE=nvcr.io/nvidia/distroless/go:v4.0.4-dev
ARG DISTROLESS_BASE_IMAGE=nvcr.io/nvidia/distroless/go:v4.0.4

FROM ${GFD_IMAGE} as gfd

Expand Down Expand Up @@ -62,11 +62,24 @@ COPY . .

RUN make build

# Build a static busybox layout: one binary plus applet symlinks (sh, rm,
# ln, sleep, cat, ...) so PATH-resolved commands in init-container wrappers
# and lifecycle hooks keep working on the non-*-dev* distroless base.
FROM debian:trixie-slim AS shell
RUN apt-get update \
&& apt-get install -y --no-install-recommends busybox-static \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir /busybox \
&& cp /bin/busybox /busybox/busybox \
&& /busybox/busybox --install -s /busybox

FROM ${DISTROLESS_BASE_IMAGE}

USER 0:0
SHELL ["/busybox/sh", "-c"]
RUN ln -s /busybox/sh /bin/sh

COPY --from=shell /busybox /busybox
RUN ["/busybox/ln", "-s", "/busybox/sh", "/bin/sh"]
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/busybox

ARG VERSION

Expand Down
Loading