Skip to content

Commit 8b55766

Browse files
Merge pull request #22 from e0ne/base-image
feat: Use distroless base image
2 parents 3d4f405 + cdaab52 commit 8b55766

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

images/Dockerfile.nvidia

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,25 @@ RUN apt-get update && \
3232
GOOS=linux GOARCH=${TARGETARCH} GOARM=${TARGETVARIANT} make clean && \
3333
GOOS=linux GOARCH=${TARGETARCH} GOARM=${TARGETVARIANT} make build
3434

35-
FROM nvcr.io/nvidia/doca/doca:3.0.0-base-rt-host
35+
FROM alpine:3 AS pkgs
36+
RUN apk add --no-cache hwdata-pci kmod
37+
38+
FROM nvcr.io/nvidia/distroless/go:v3.1.12-dev
39+
40+
USER 0:0
41+
SHELL ["/busybox/sh", "-c"]
42+
RUN ln -s /busybox/sh /bin/sh
3643

3744
ARG TARGETPLATFORM
3845
ARG TARGETARCH
3946
ARG TARGETVARIANT
4047

4148
COPY --from=builder /usr/src/sriov-network-device-plugin/build/sriovdp /usr/bin/
42-
WORKDIR /
49+
RUN mkdir -p /usr/share/hwdata
50+
COPY --from=pkgs /usr/share/hwdata/pci.ids /usr/share/hwdata/pci.ids
51+
COPY --from=pkgs /sbin/lsmod /sbin/lsmod
4352

44-
RUN apt-get update && apt-get install -y --no-install-recommends kmod=29-1ubuntu1 && \
45-
rm -rf /var/lib/apt/lists/*
53+
WORKDIR /
4654

4755
COPY --from=builder /usr/src/sriov-network-device-plugin ./src
4856

0 commit comments

Comments
 (0)