File tree Expand file tree Collapse file tree 7 files changed +63
-14
lines changed
Expand file tree Collapse file tree 7 files changed +63
-14
lines changed Original file line number Diff line number Diff line change 1616
1717ARG BASE_IMAGE_GO_DISTROLESS_DEV
1818
19- FROM golang:1.23 AS builder
19+ FROM golang:1.25 AS builder
20+
21+ ARG GOPROXY
22+ ENV GOPROXY=$GOPROXY
23+
2024WORKDIR /go/src/github.com/k8snetworkplumbingwg/sriov-network-operator
2125COPY . .
2226RUN make _build-manager BIN_PATH=build/_output/cmd
2327RUN make _build-sriov-network-operator-config-cleanup BIN_PATH=build/_output/cmd
2428
2529FROM ${BASE_IMAGE_GO_DISTROLESS_DEV:-nvcr.io/nvidia/distroless/go:v3.2.1-dev}
30+ USER 65532:65532
2631COPY --from=builder /go/src/github.com/k8snetworkplumbingwg/sriov-network-operator/build/_output/cmd/manager /usr/bin/sriov-network-operator
2732COPY --from=builder /go/src/github.com/k8snetworkplumbingwg/sriov-network-operator/build/_output/cmd/sriov-network-operator-config-cleanup /usr/bin/sriov-network-operator-config-cleanup
2833COPY bindata /bindata
2934# copy project sources into the container
3035COPY . /src
3136ENV OPERATOR_NAME=sriov-network-operator
37+ WORKDIR /
3238CMD ["/usr/bin/sriov-network-operator"]
Original file line number Diff line number Diff line change @@ -7,7 +7,9 @@ FROM quay.io/centos/centos:stream9
77ARG MSTFLINT=mstflint
88# We have to ensure that pciutils is installed. This package is needed for mstfwreset to succeed.
99# xref pkg/vendors/mellanox/mellanox.go#L150
10- RUN if [ "$(uname -m)" = "s390x" ]; then yum -y install hwdata pciutils; else yum -y install hwdata pciutils "${MSTFLINT}"; fi && yum clean all
10+ RUN ARCH_DEP_PKGS=$(if [ "$(uname -m)" != "s390x" ]; then echo -n ${MSTFLINT} ; fi) \
11+ && yum -y install hwdata pciutils $ARCH_DEP_PKGS \
12+ && yum clean all
1113LABEL io.k8s.display-name="sriov-network-config-daemon" \
1214 io.k8s.description="This is a daemon that manage and config sriov network devices in Kubernetes cluster"
1315COPY --from=builder /go/src/github.com/k8snetworkplumbingwg/sriov-network-operator/build/_output/cmd/sriov-network-config-daemon /usr/bin/
Original file line number Diff line number Diff line change 1- FROM golang:1.23 AS builder
1+ FROM golang:1.25 AS builder
2+
3+ ARG GOPROXY
4+ ENV GOPROXY=$GOPROXY
5+
26WORKDIR /go/src/github.com/k8snetworkplumbingwg/sriov-network-operator
37COPY . .
48RUN make _build-sriov-network-config-daemon BIN_PATH=build/_output/cmd
59
610FROM nvcr.io/nvstaging/mellanox/ubuntu-pro-stig:24.04
7- ARG MSTFLINT=mstflint
8- # We have to ensure that pciutils is installed. This package is needed for mstfwreset to succeed.
11+ # We have to ensure that pciutils is installed. These packages are needed for mstfwreset to succeed.
912# xref pkg/vendors/mellanox/mellanox.go#L150
10- RUN apt update && apt -y install hwdata pciutils mstflint
13+ RUN apt update && apt -y install hwdata pciutils curl
14+
15+ ARG TARGETARCH
16+ ENV MFT_VERSION=4.33.0-169
17+ RUN case ${TARGETARCH} in \
18+ amd64) ARCH=x86_64 ;; \
19+ arm64) ARCH=arm64 ;; \
20+ *) echo "Unsupported architecture: ${TARGETARCH}" && exit 1 ;; \
21+ esac && \
22+ curl -fsSL https://www.mellanox.com/downloads/MFT/mft-${MFT_VERSION}-${ARCH}-deb.tgz | tar -xz -C /tmp && \
23+ cd /tmp/mft-${MFT_VERSION}-${ARCH}-deb && \
24+ ./install.sh --without-kernel
25+
26+ RUN ln -s $(which mlxconfig) /usr/bin/mstconfig
27+ RUN ln -s $(which mlxfwreset) /usr/bin/mstfwreset
28+
1129LABEL io.k8s.display-name="sriov-network-config-daemon" \
1230 io.k8s.description="This is a daemon that manage and config sriov network devices in Kubernetes cluster"
1331COPY --from=builder /go/src/github.com/k8snetworkplumbingwg/sriov-network-operator/build/_output/cmd/sriov-network-config-daemon /usr/bin/
Original file line number Diff line number Diff line change 1717ARG BASE_IMAGE_DOCA_BASE_RT_HOST
1818
1919FROM golang:1.23 AS builder
20+
21+ ARG GOPROXY
22+ ENV GOPROXY=$GOPROXY
23+
2024WORKDIR /go/src/github.com/k8snetworkplumbingwg/sriov-network-operator
2125COPY . .
2226RUN make _build-sriov-network-config-daemon BIN_PATH=build/_output/cmd
2327
2428FROM ${BASE_IMAGE_DOCA_BASE_RT_HOST:-nvcr.io/nvidia/doca/doca:3.1.0-base-rt-host}
25- ARG MSTFLINT=mstflint
26- # We have to ensure that pciutils is installed. This package is needed for mstfwreset to succeed.
29+ # We have to ensure that pciutils is installed. These packages are needed for mstfwreset to succeed.
2730# xref pkg/vendors/mellanox/mellanox.go#L150
28- RUN ARCH_DEP_PKGS=$(if [ "$(uname -m)" != "s390x" ]; then echo -n ${MSTFLINT} ; fi) && apt-get update && apt-get install -y hwdata pciutils $ARCH_DEP_PKGS && apt-get clean && rm -rf /var/lib/apt/lists/*
31+ RUN apt-get update && apt-get install -y hwdata pciutils curl && apt-get clean && rm -rf /var/lib/apt/lists/*
32+
33+ ARG TARGETARCH
34+ ENV MFT_VERSION=4.33.0-169
35+ RUN case ${TARGETARCH} in \
36+ amd64) ARCH=x86_64 ;; \
37+ arm64) ARCH=arm64 ;; \
38+ *) echo "Unsupported architecture: ${TARGETARCH}" && exit 1 ;; \
39+ esac && \
40+ curl -fsSL https://www.mellanox.com/downloads/MFT/mft-${MFT_VERSION}-${ARCH}-deb.tgz | tar -xz -C /tmp && \
41+ cd /tmp/mft-${MFT_VERSION}-${ARCH}-deb && \
42+ ./install.sh --without-kernel
43+
44+ RUN ln -s $(which mlxconfig) /usr/bin/mstconfig
45+ RUN ln -s $(which mlxfwreset) /usr/bin/mstfwreset
46+
2947LABEL io.k8s.display-name="sriov-network-config-daemon" \
3048 io.k8s.description="This is a daemon that manage and config sriov network devices in Kubernetes cluster"
3149COPY --from=builder /go/src/github.com/k8snetworkplumbingwg/sriov-network-operator/build/_output/cmd/sriov-network-config-daemon /usr/bin/
Original file line number Diff line number Diff line change 1- FROM golang:1.25 AS builder
1+ FROM golang:1.23 AS builder
22WORKDIR /go/src/github.com/k8snetworkplumbingwg/sriov-network-operator
33COPY . .
44RUN make _build-webhook BIN_PATH=build/_output/cmd
Original file line number Diff line number Diff line change 1717ARG BASE_IMAGE_GO_DISTROLESS_DEV
1818
1919FROM golang:1.23 AS builder
20+
21+ ARG GOPROXY
22+ ENV GOPROXY=$GOPROXY
23+
2024WORKDIR /go/src/github.com/k8snetworkplumbingwg/sriov-network-operator
2125COPY . .
2226RUN make _build-webhook BIN_PATH=build/_output/cmd
2327
2428FROM ${BASE_IMAGE_GO_DISTROLESS_DEV:-nvcr.io/nvidia/distroless/go:v3.2.1-dev}
29+ USER 65532:65532
2530LABEL io.k8s.display-name="sriov-network-webhook" \
2631 io.k8s.description="This is an admission controller webhook that mutates and validates customer resources of sriov network operator."
27- USER 1001
2832# copy project sources into the container
2933COPY . /src
3034COPY --from=builder /go/src/github.com/k8snetworkplumbingwg/sriov-network-operator/build/_output/cmd/webhook /usr/bin/webhook
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ export WATCH_NAMESPACE?=openshift-sriov-network-operator
3232export HOME? =$(PWD )
3333export GOPATH? =$(shell go env GOPATH)
3434export GO111MODULE =on
35+ GOPROXY ?= $(shell go env GOPROXY)
3536PKGS =$(shell go list ./... | grep -v -E '/vendor/|/test|/examples')
3637TESTPKGS? =./...
3738
7172 @rm -rf $(BIN_DIR )
7273
7374image : ; $(info Building images...)
74- $(IMAGE_BUILDER ) build -f $(DOCKERFILE ) -t $(IMAGE_TAG ) $(CURPATH ) $(IMAGE_BUILD_OPTS )
75- $(IMAGE_BUILDER ) build -f $(DOCKERFILE_CONFIG_DAEMON ) -t $(CONFIG_DAEMON_IMAGE_TAG ) $(CURPATH ) $(IMAGE_BUILD_OPTS )
76- $(IMAGE_BUILDER ) build -f $(DOCKERFILE_WEBHOOK ) -t $(WEBHOOK_IMAGE_TAG ) $(CURPATH ) $(IMAGE_BUILD_OPTS )
75+ $(IMAGE_BUILDER ) build -f $(DOCKERFILE ) -t $(IMAGE_TAG ) $(CURPATH ) GOPROXY= " $( GOPROXY ) " $(IMAGE_BUILD_OPTS )
76+ $(IMAGE_BUILDER ) build -f $(DOCKERFILE_CONFIG_DAEMON ) -t $(CONFIG_DAEMON_IMAGE_TAG ) $(CURPATH ) GOPROXY= " $( GOPROXY ) " $(IMAGE_BUILD_OPTS )
77+ $(IMAGE_BUILDER ) build -f $(DOCKERFILE_WEBHOOK ) -t $(WEBHOOK_IMAGE_TAG ) $(CURPATH ) GOPROXY= " $( GOPROXY ) " $(IMAGE_BUILD_OPTS )
7778
7879# Run tests
7980test : generate lint manifests envtest
You can’t perform that action at this time.
0 commit comments