Hyunsun Moon | 5c2b9f2 | 2019-07-29 17:37:29 -0600 | [diff] [blame] | 1 | # |
| 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 |
| 18 | FROM golang:1.10 AS multus |
| 19 | RUN git clone -q --depth 1 https://github.com/intel/multus-cni.git /go/src/github.com/intel/multus-cni |
| 20 | WORKDIR /go/src/github.com/intel/multus-cni |
| 21 | RUN ./build |
| 22 | |
| 23 | # Build sriov plugin |
| 24 | FROM golang:1.10 AS sriov-cni |
| 25 | RUN git clone -q -b dev/k8s-deviceid-model https://github.com/Intel-Corp/sriov-cni.git /go/src/github.com/intel-corp/sriov-cni |
| 26 | WORKDIR /go/src/github.com/intel-corp/sriov-cni |
| 27 | RUN ./build |
| 28 | |
| 29 | # Build sriov device plugin |
| 30 | FROM golang:1.10 AS sriov-dp |
| 31 | RUN git clone -q https://github.com/intel/sriov-network-device-plugin.git /go/src/github.com/intel/sriov-network-device-plugin |
| 32 | WORKDIR /go/src/github.com/intel/sriov-network-device-plugin |
| 33 | RUN make |
| 34 | |
| 35 | # Build centralip ipam plugin |
| 36 | FROM golang:1.10 AS centralip-ipam |
| 37 | RUN go get -u github.com/kardianos/govendor |
| 38 | RUN git clone -q https://github.com/John-Lin/ovs-cni.git /go/src/github.com/John-Lin/ovs-cni |
| 39 | WORKDIR /go/src/github.com/John-Lin/ovs-cni |
| 40 | RUN govendor sync && ./build.sh |
| 41 | |
| 42 | # Build vfioveth plugin |
| 43 | FROM busybox as vfioveth |
| 44 | RUN wget -O /bin/vfioveth https://raw.githubusercontent.com/clearlinux/cloud-native-setup/master/clr-k8s-examples/9-multi-network/cni/vfioveth |
| 45 | RUN wget -O /bin/jq https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 |
| 46 | RUN chmod +x /bin/vfioveth /bin/jq |
| 47 | |
Hyunsun Moon | 57c4bcf | 2019-08-22 00:31:54 -0500 | [diff] [blame^] | 48 | # Copy static IPAM plugin |
| 49 | FROM busybox as static |
| 50 | RUN wget https://github.com/containernetworking/plugins/releases/download/v0.8.2/cni-plugins-linux-amd64-v0.8.2.tgz |
| 51 | RUN tar xvfz cni-plugins-linux-amd64-v0.8.2.tgz |
| 52 | RUN cp ./static /bin/static |
| 53 | |
Hyunsun Moon | 5c2b9f2 | 2019-07-29 17:37:29 -0600 | [diff] [blame] | 54 | # Final image |
| 55 | FROM centos/systemd as omec-cni |
| 56 | WORKDIR /tmp/cni/bin |
| 57 | COPY --from=multus /go/src/github.com/intel/multus-cni/bin/multus . |
| 58 | COPY --from=sriov-cni /go/src/github.com/intel-corp/sriov-cni/bin/sriov . |
| 59 | COPY --from=centralip-ipam /go/src/github.com/John-Lin/ovs-cni/bin/centralip . |
| 60 | COPY --from=vfioveth /bin/vfioveth . |
| 61 | COPY --from=vfioveth /bin/jq . |
Hyunsun Moon | 57c4bcf | 2019-08-22 00:31:54 -0500 | [diff] [blame^] | 62 | COPY --from=static /bin/static . |
Hyunsun Moon | 5c2b9f2 | 2019-07-29 17:37:29 -0600 | [diff] [blame] | 63 | WORKDIR /usr/bin |
| 64 | COPY --from=sriov-dp /go/src/github.com/intel/sriov-network-device-plugin/build/sriovdp . |