forked from rancher/image-build-ib-sriov-cni
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
26 lines (24 loc) · 741 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
ARG BCI_IMAGE=registry.suse.com/bci/bci-base
ARG GO_IMAGE=rancher/hardened-build-base:v1.20.14b1
# Build the project
FROM ${GO_IMAGE} as builder
RUN set -x && \
apk --no-cache add \
git \
make
ARG TAG=v1.1.1
RUN git clone --depth=1 https://github.com/k8snetworkplumbingwg/ib-sriov-cni
WORKDIR ib-sriov-cni
RUN git fetch --all --tags --prune
RUN git checkout tags/${TAG} -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/ib-sriov-cni/images/entrypoint.sh /
COPY --from=builder /go/ib-sriov-cni/build/ib-sriov /usr/bin/
ENTRYPOINT ["/entrypoint.sh"]