blob: 1fd50142992d6624b9c65624410cbc8e6f28f04e [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
Hyunsun Moon5c2b9f22019-07-29 17:37:29 -060017# Build sriov plugin
18FROM golang:1.10 AS sriov-cni
19RUN git clone -q -b dev/k8s-deviceid-model https://github.com/Intel-Corp/sriov-cni.git /go/src/github.com/intel-corp/sriov-cni
20WORKDIR /go/src/github.com/intel-corp/sriov-cni
21RUN ./build
22
23# Build sriov device plugin
24FROM golang:1.10 AS sriov-dp
25RUN git clone -q https://github.com/intel/sriov-network-device-plugin.git /go/src/github.com/intel/sriov-network-device-plugin
26WORKDIR /go/src/github.com/intel/sriov-network-device-plugin
27RUN make
28
29# Build centralip ipam plugin
30FROM golang:1.10 AS centralip-ipam
31RUN go get -u github.com/kardianos/govendor
32RUN git clone -q https://github.com/John-Lin/ovs-cni.git /go/src/github.com/John-Lin/ovs-cni
33WORKDIR /go/src/github.com/John-Lin/ovs-cni
34RUN govendor sync && ./build.sh
35
36# Build vfioveth plugin
37FROM busybox as vfioveth
38RUN wget -O /bin/vfioveth https://raw.githubusercontent.com/clearlinux/cloud-native-setup/master/clr-k8s-examples/9-multi-network/cni/vfioveth
39RUN wget -O /bin/jq https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64
40RUN chmod +x /bin/vfioveth /bin/jq
41
Hyunsun Moon57c4bcf2019-08-22 00:31:54 -050042# Copy static IPAM plugin
43FROM busybox as static
44RUN wget https://github.com/containernetworking/plugins/releases/download/v0.8.2/cni-plugins-linux-amd64-v0.8.2.tgz
45RUN tar xvfz cni-plugins-linux-amd64-v0.8.2.tgz
46RUN cp ./static /bin/static
47
Hyunsun Moon5c2b9f22019-07-29 17:37:29 -060048# Final image
49FROM centos/systemd as omec-cni
50WORKDIR /tmp/cni/bin
Hyunsun Moon5c2b9f22019-07-29 17:37:29 -060051COPY --from=sriov-cni /go/src/github.com/intel-corp/sriov-cni/bin/sriov .
Hyunsun Moon5c2b9f22019-07-29 17:37:29 -060052COPY --from=vfioveth /bin/vfioveth .
53COPY --from=vfioveth /bin/jq .
Hyunsun Moon57c4bcf2019-08-22 00:31:54 -050054COPY --from=static /bin/static .
Hyunsun Moon5c2b9f22019-07-29 17:37:29 -060055WORKDIR /usr/bin
56COPY --from=sriov-dp /go/src/github.com/intel/sriov-network-device-plugin/build/sriovdp .