-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile-cni
More file actions
36 lines (27 loc) · 1.12 KB
/
Dockerfile-cni
File metadata and controls
36 lines (27 loc) · 1.12 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
FROM golang:1.22 as builder
WORKDIR /workspace
COPY . .
RUN cd sriov-cni && make build && \
cd ../ib-sriov-cni && make build && \
cd ../whereabouts && make build
FROM alpine:3.15 as plugin
WORKDIR /plugins
ARG FLANNEL_VERSION=v1.4.1
ARG VERSION=v1.4.0
RUN apkArch="$(apk --print-arch)"; \
case "$apkArch" in \
aarch64) ARCH='arm64' ;; \
x86_64) ARCH='amd64' ;; \
esac; \
wget -O flannel https://github.com/flannel-io/cni-plugin/releases/download/${FLANNEL_VERSION}-flannel1/flannel-$ARCH && \
chmod +x flannel && \
wget -q -O - https://github.com/containernetworking/plugins/releases/download/${VERSION}/cni-plugins-linux-$ARCH-${VERSION}.tgz | tar xzf -
FROM alpine:3.15
COPY --from=plugin /plugins /plugins
COPY --from=builder /workspace/ib-sriov-cni/build/ib-sriov /
COPY --from=builder /workspace/sriov-cni/build/sriov /
COPY --from=builder /workspace/whereabouts/bin/whereabouts /
COPY --from=builder /workspace/whereabouts/bin/ip-control-loop /
COPY --from=builder /workspace/scripts/entrypoint.sh /
COPY --from=builder /workspace/scripts/install.sh /
ENTRYPOINT ["/entrypoint.sh"]