blob: a2a3cbc3d9b2e124a8d261a941741651de9eaf58 [file] [log] [blame]
Hyunsun Moon5c2b9f22019-07-29 17:37:29 -06001#
2# Copyright 2019-present Open Networking Foundation
3# Copyright (c) 2019 Intel Corporation
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16
17# Build multus plugin
18FROM golang:1.10 AS multus
19RUN git clone -q --depth 1 https://github.com/intel/multus-cni.git /go/src/github.com/intel/multus-cni
20WORKDIR /go/src/github.com/intel/multus-cni
21RUN ./build
22
23# Build sriov plugin
24FROM golang:1.10 AS sriov-cni
25RUN git clone -q -b dev/k8s-deviceid-model https://github.com/Intel-Corp/sriov-cni.git /go/src/github.com/intel-corp/sriov-cni
26WORKDIR /go/src/github.com/intel-corp/sriov-cni
27RUN ./build
28
29# Build sriov device plugin
30FROM golang:1.10 AS sriov-dp
31RUN git clone -q https://github.com/intel/sriov-network-device-plugin.git /go/src/github.com/intel/sriov-network-device-plugin
32WORKDIR /go/src/github.com/intel/sriov-network-device-plugin
33RUN make
34
35# Build centralip ipam plugin
36FROM golang:1.10 AS centralip-ipam
37RUN go get -u github.com/kardianos/govendor
38RUN git clone -q https://github.com/John-Lin/ovs-cni.git /go/src/github.com/John-Lin/ovs-cni
39WORKDIR /go/src/github.com/John-Lin/ovs-cni
40RUN govendor sync && ./build.sh
41
42# Build vfioveth plugin
43FROM busybox as vfioveth
44RUN wget -O /bin/vfioveth https://raw.githubusercontent.com/clearlinux/cloud-native-setup/master/clr-k8s-examples/9-multi-network/cni/vfioveth
45RUN wget -O /bin/jq https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64
46RUN chmod +x /bin/vfioveth /bin/jq
47
Hyunsun Moon57c4bcf2019-08-22 00:31:54 -050048# Copy static IPAM plugin
49FROM busybox as static
50RUN wget https://github.com/containernetworking/plugins/releases/download/v0.8.2/cni-plugins-linux-amd64-v0.8.2.tgz
51RUN tar xvfz cni-plugins-linux-amd64-v0.8.2.tgz
52RUN cp ./static /bin/static
53
Hyunsun Moon5c2b9f22019-07-29 17:37:29 -060054# Final image
55FROM centos/systemd as omec-cni
56WORKDIR /tmp/cni/bin
57COPY --from=multus /go/src/github.com/intel/multus-cni/bin/multus .
58COPY --from=sriov-cni /go/src/github.com/intel-corp/sriov-cni/bin/sriov .
59COPY --from=centralip-ipam /go/src/github.com/John-Lin/ovs-cni/bin/centralip .
60COPY --from=vfioveth /bin/vfioveth .
61COPY --from=vfioveth /bin/jq .
Hyunsun Moon57c4bcf2019-08-22 00:31:54 -050062COPY --from=static /bin/static .
Hyunsun Moon5c2b9f22019-07-29 17:37:29 -060063WORKDIR /usr/bin
64COPY --from=sriov-dp /go/src/github.com/intel/sriov-network-device-plugin/build/sriovdp .