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 | |
| 48 | # Final image |
| 49 | FROM centos/systemd as omec-cni |
| 50 | WORKDIR /tmp/cni/bin |
| 51 | COPY --from=multus /go/src/github.com/intel/multus-cni/bin/multus . |
| 52 | COPY --from=sriov-cni /go/src/github.com/intel-corp/sriov-cni/bin/sriov . |
| 53 | COPY --from=centralip-ipam /go/src/github.com/John-Lin/ovs-cni/bin/centralip . |
| 54 | COPY --from=vfioveth /bin/vfioveth . |
| 55 | COPY --from=vfioveth /bin/jq . |
| 56 | WORKDIR /usr/bin |
| 57 | COPY --from=sriov-dp /go/src/github.com/intel/sriov-network-device-plugin/build/sriovdp . |
| 58 | |
| 59 | ARG org_label_schema_version=unknown |
| 60 | ARG org_label_schema_vcs_url=unknown |
| 61 | ARG org_label_schema_vcs_ref=unknown |
| 62 | ARG org_label_schema_build_date=unknown |
| 63 | ARG org_opencord_vcs_commit_date=unknown |
| 64 | |
| 65 | LABEL org.label-schema.schema-version=1.0 \ |
| 66 | org.label-schema.name=omec-cni \ |
| 67 | org.label-schema.version=$org_label_schema_version \ |
| 68 | org.label-schema.vcs-url=$org_label_schema_vcs_url \ |
| 69 | org.label-schema.vcs-ref=$org_label_schema_vcs_ref \ |
| 70 | org.label-schema.build-date=$org_label_schema_build_date \ |
| 71 | org.opencord.vcs-commit-date=$org_opencord_vcs_commit_date |