blob: 0a955024880ff91b874c995ffdc585f4848a2970 [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
48# Final image
49FROM centos/systemd as omec-cni
50WORKDIR /tmp/cni/bin
51COPY --from=multus /go/src/github.com/intel/multus-cni/bin/multus .
52COPY --from=sriov-cni /go/src/github.com/intel-corp/sriov-cni/bin/sriov .
53COPY --from=centralip-ipam /go/src/github.com/John-Lin/ovs-cni/bin/centralip .
54COPY --from=vfioveth /bin/vfioveth .
55COPY --from=vfioveth /bin/jq .
56WORKDIR /usr/bin
57COPY --from=sriov-dp /go/src/github.com/intel/sriov-network-device-plugin/build/sriovdp .
58
59ARG org_label_schema_version=unknown
60ARG org_label_schema_vcs_url=unknown
61ARG org_label_schema_vcs_ref=unknown
62ARG org_label_schema_build_date=unknown
63ARG org_opencord_vcs_commit_date=unknown
64
65LABEL 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