forked from k8snetworkplumbingwg/sriov-network-operator
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile.sriov-network-config-daemon.nvidia
More file actions
61 lines (52 loc) · 2.67 KB
/
Dockerfile.sriov-network-config-daemon.nvidia
File metadata and controls
61 lines (52 loc) · 2.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Copyright 2025 NVIDIA CORPORATION & AFFILIATES
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
ARG BASE_IMAGE_DOCA_BASE_RT_HOST
FROM golang:1.25 AS builder
ARG GOPROXY
ENV GOPROXY=$GOPROXY
WORKDIR /go/src/github.com/k8snetworkplumbingwg/sriov-network-operator
COPY . .
RUN make _build-sriov-network-config-daemon BIN_PATH=build/_output/cmd
FROM ${BASE_IMAGE_DOCA_BASE_RT_HOST:-nvcr.io/nvidia/doca/doca:3.2.1-base-rt-host}
# We have to ensure that pciutils is installed. These packages are needed for mstfwreset to succeed.
# xref pkg/vendors/mellanox/mellanox.go#L150
# DOCA repositories have a GPG issue, so we need to allow insecure repositories.
# GPG error: https://linux.mellanox.com/public/repo/doca/3.2.1/ubuntu22.04/x86_64 ./ Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A024F6F0E6D6A281
RUN apt-get update -o Acquire::AllowInsecureRepositories=true && \
apt-get install -y --allow-unauthenticated hwdata pciutils curl mstflint && \
apt-get clean && rm -rf /var/lib/apt/lists/*
ARG TARGETARCH
ENV MFT_VERSION=4.33.0-169
RUN case ${TARGETARCH} in \
amd64) ARCH=x86_64 ;; \
arm64) ARCH=arm64 ;; \
*) echo "Unsupported architecture: ${TARGETARCH}" && exit 1 ;; \
esac && \
curl -fsSL https://www.mellanox.com/downloads/MFT/mft-${MFT_VERSION}-${ARCH}-deb.tgz | tar -xz --no-same-owner -C /tmp && \
cd /tmp/mft-${MFT_VERSION}-${ARCH}-deb && \
./install.sh --without-kernel
# Delete the original mstconfig and mstfwreset binaries
# We only need their dependent packages, not the binaries themselves.
RUN rm -f /usr/bin/mstconfig /usr/bin/mstfwreset
RUN ln -s $(which mlxconfig) /usr/bin/mstconfig
RUN ln -s $(which mlxfwreset) /usr/bin/mstfwreset
LABEL io.k8s.display-name="sriov-network-config-daemon" \
io.k8s.description="This is a daemon that manage and config sriov network devices in Kubernetes cluster"
COPY --from=builder /go/src/github.com/k8snetworkplumbingwg/sriov-network-operator/build/_output/cmd/sriov-network-config-daemon /usr/bin/
COPY bindata /bindata
# copy project sources into the container
COPY . /src
CMD ["/usr/bin/sriov-network-config-daemon"]