forked from rancher/image-build-sriov-cni
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
28 lines (26 loc) · 787 Bytes
/
Dockerfile
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
ARG TAG="2.7.0"
ARG COMMIT="14fbf4a4addb9e946698edc7c5ea4cf20fe498e5"
ARG BCI_IMAGE=registry.suse.com/bci/bci-base
ARG GO_IMAGE=rancher/hardened-build-base:v1.21.8b1
# Build the project
FROM ${GO_IMAGE} as builder
RUN set -x && \
apk --no-cache add \
git \
make
ARG TAG
RUN git clone --depth=1 https://github.com/k8snetworkplumbingwg/sriov-cni
WORKDIR sriov-cni
RUN git fetch --all --tags --prune
RUN git checkout ${COMMIT} -b ${TAG}
RUN make clean && make build
# Create the sriov-cni image
FROM ${BCI_IMAGE}
RUN zypper refresh && \
zypper update -y && \
zypper install -y gawk which && \
zypper clean -a
WORKDIR /
COPY --from=builder /go/sriov-cni/build/sriov /usr/bin/
COPY --from=builder /go/sriov-cni/images/entrypoint.sh /
ENTRYPOINT ["/entrypoint.sh"]