|
| 1 | +# |
| 2 | +# This is the OpenShift ovn overlay network image. |
| 3 | +# it provides an overlay network using ovs/ovn/ovn-kube |
| 4 | +# |
| 5 | +# The standard name for this image is ovn-kube |
| 6 | + |
| 7 | +# Notes: |
| 8 | +# This is for a build where the ovn-kubernetes utilities |
| 9 | +# are built in this Dockerfile and included in the image (instead of the rpm) |
| 10 | +# |
| 11 | + |
| 12 | +FROM openshift/golang-builder:1.10 AS builder |
| 13 | +ENV SOURCE_GIT_COMMIT=674977b1fdf0f966970179b9fae338f8347b2dfe SOURCE_GIT_TAG=674977b |
| 14 | + |
| 15 | +WORKDIR /go-controller |
| 16 | +COPY go-controller/ . |
| 17 | + |
| 18 | +# build the binaries |
| 19 | +RUN '/opt/cov-sa-2019.09/bin/cov-build' '--dir=/cov' '--append-log' 'sh' '-c' 'make' |
| 20 | + |
| 21 | +FROM openshift/ose-cli:v4.1.0-201905191700 AS cli |
| 22 | +ENV SOURCE_GIT_COMMIT=674977b1fdf0f966970179b9fae338f8347b2dfe SOURCE_GIT_TAG=674977b |
| 23 | + |
| 24 | +FROM openshift/ose-base:v4.1.0-201905191700 |
| 25 | +ENV SOURCE_GIT_COMMIT=674977b1fdf0f966970179b9fae338f8347b2dfe SOURCE_GIT_TAG=674977b |
| 26 | + |
| 27 | +USER root |
| 28 | + |
| 29 | +ENV PYTHONDONTWRITEBYTECODE yes |
| 30 | + |
| 31 | +# install needed rpms - openvswitch must be 2.9.2 or higher |
| 32 | +# install selinux-policy first to avoid a race |
| 33 | +RUN '/opt/cov-sa-2019.09/bin/cov-build' '--dir=/cov' '--append-log' 'sh' '-c' $'yum install -y \tselinux-policy && \tyum clean all' |
| 34 | + |
| 35 | +RUN '/opt/cov-sa-2019.09/bin/cov-build' '--dir=/cov' '--append-log' 'sh' '-c' $'yum install -y \tPyYAML bind-utils \topenssl \tnumactl-libs \tfirewalld-filesystem \tlibpcap \thostname \t\"openvswitch2.11\" \t\"openvswitch2.11-ovn-common\" \t\"openvswitch2.11-ovn-central\" \t\"openvswitch2.11-ovn-host\" \t\"openvswitch2.11-ovn-vtep\" \t\"openvswitch2.11-devel\" \tcontainernetworking-plugins \tiproute strace socat && \tyum clean all' |
| 36 | + |
| 37 | +RUN '/opt/cov-sa-2019.09/bin/cov-build' '--dir=/cov' '--append-log' 'sh' '-c' 'rm -rf /var/cache/yum' |
| 38 | + |
| 39 | +RUN '/opt/cov-sa-2019.09/bin/cov-build' '--dir=/cov' '--append-log' 'sh' '-c' 'mkdir -p /var/run/openvswitch && mkdir -p /etc/cni/net.d && mkdir -p /opt/cni/bin && mkdir -p /usr/libexec/cni/' |
| 40 | + |
| 41 | +COPY --from=builder /go-controller/_output/go/bin/ovnkube /usr/bin/ |
| 42 | +COPY --from=builder /go-controller/_output/go/bin/ovn-kube-util /usr/bin/ |
| 43 | +COPY --from=builder /go-controller/_output/go/bin/ovn-k8s-cni-overlay /usr/libexec/cni/ovn-k8s-cni-overlay |
| 44 | + |
| 45 | +COPY --from=cli /usr/bin/oc /usr/bin |
| 46 | +RUN '/opt/cov-sa-2019.09/bin/cov-build' '--dir=/cov' '--append-log' 'sh' '-c' 'ln -s /usr/bin/oc /usr/bin/kubectl' |
| 47 | + |
| 48 | +# copy git commit number into image |
| 49 | +COPY .git/HEAD /root/.git/HEAD |
| 50 | +COPY .git/refs/heads/ /root/.git/refs/heads/ |
| 51 | + |
| 52 | +# ovnkube.sh is the entry point. This script examines environment |
| 53 | +# variables to direct operation and configure ovn |
| 54 | +COPY dist/images/ovnkube.sh /root/ |
| 55 | +COPY dist/images/ovn-debug.sh /root/ |
| 56 | +# override the rpm's ovn_k8s.conf with this local copy |
| 57 | +COPY dist/images/ovn_k8s.conf /etc/openvswitch/ovn_k8s.conf |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | +WORKDIR /root |
| 62 | +ENTRYPOINT /root/ovnkube.sh |
| 63 | + |
| 64 | +LABEL \ |
| 65 | + io.k8s.description="This is a component of OpenShift Container Platform that provides an overlay network using ovn." \ |
| 66 | + com.redhat.component="ose-ovn-kubernetes-container" \ |
| 67 | + maintainer="Phil Cameron < [email protected]>" \ |
| 68 | + name="openshift/ose-ovn-kubernetes" \ |
| 69 | + License="GPLv2+" \ |
| 70 | + io.k8s.display-name="ovn kubernetes" \ |
| 71 | + io.openshift.build.source-location="https://github.com/openshift/ovn-kubernetes" \ |
| 72 | + summary="This is a component of OpenShift Container Platform that provides an overlay network using ovn." \ |
| 73 | + io.openshift.build.commit.url="https://github.com/openshift/ovn-kubernetes/commit/674977b1fdf0f966970179b9fae338f8347b2dfe" \ |
| 74 | + version="v4.1.0" \ |
| 75 | + io.openshift.build.commit.id="674977b1fdf0f966970179b9fae338f8347b2dfe" \ |
| 76 | + release="201905231545" \ |
| 77 | + vendor="Red Hat" \ |
| 78 | + io.openshift.tags="openshift" |
| 79 | + |
0 commit comments