forked from ovn-kubernetes/ovn-kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.centos
89 lines (74 loc) · 3.18 KB
/
Dockerfile.centos
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#
# This is the OpenShift ovn overlay network image.
# it provides an overlay network using ovs/ovn/ovn-kube
#
# The standard name for this image is ovn-kube
# Notes:
# This is for a development build where the ovn-kubernetes utilities
# are built in this Dockerfile and included in the image (instead of the rpm)
#
# This is based on centos:7
# openvswitch rpms are from
# http://cbs.centos.org/kojifiles/packages/openvswitch/2.9.0/4.el7/x86_64/
#
# So this file will change over time.
FROM centos:7
USER root
ENV PYTHONDONTWRITEBYTECODE yes
# install golang and build tools
RUN yum install -y \
make which golang && \
yum clean all
# copy git commit number into image
RUN mkdir -p go-controller /root/.git/ /root/.git/refs/heads/
COPY .git/HEAD /root/.git/HEAD
COPY .git/refs/heads/ /root/.git/refs/heads/
# build the binaries
COPY go-controller/ go-controller/
RUN cd go-controller && make
# remove build tools
RUN yum remove -y \
gmake which golang \
cpp gcc glibc-devel glibc-headers golang-bin \
golang-src.noarch kernel-headers.x86_64 \
libgomp.x86_64 libmpc.x86_64 mpfr.x86_64 && \
yum clean all
# install needed rpms
RUN yum install -y \
PyYAML bind-utils \
openssl \
numactl-libs \
firewalld-filesystem \
libpcap \
hostname \
iproute strace socat && \
yum clean all
# get a reasonable version of openvswitch (2.9.0 or higher)
RUN rpm -i http://cbs.centos.org/kojifiles/packages/openvswitch/2.9.0/4.el7/x86_64/openvswitch-2.9.0-4.el7.x86_64.rpm
RUN rpm -i http://cbs.centos.org/kojifiles/packages/openvswitch/2.9.0/4.el7/x86_64/openvswitch-ovn-common-2.9.0-4.el7.x86_64.rpm
RUN rpm -i http://cbs.centos.org/kojifiles/packages/openvswitch/2.9.0/4.el7/x86_64/openvswitch-ovn-central-2.9.0-4.el7.x86_64.rpm
RUN rpm -i http://cbs.centos.org/kojifiles/packages/openvswitch/2.9.0/4.el7/x86_64/openvswitch-ovn-host-2.9.0-4.el7.x86_64.rpm
RUN rpm -i http://cbs.centos.org/kojifiles/packages/openvswitch/2.9.0/4.el7/x86_64/openvswitch-ovn-vtep-2.9.0-4.el7.x86_64.rpm
RUN rpm -i http://cbs.centos.org/kojifiles/packages/openvswitch/2.9.0/4.el7/x86_64/openvswitch-devel-2.9.0-4.el7.x86_64.rpm
RUN rpm -i http://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/c/containernetworking-cni-0.5.1-1.el7.x86_64.rpm
RUN rm -rf /var/cache/yum
RUN mkdir -p /var/run/openvswitch && \
mkdir -p /etc/cni/net.d && \
mkdir -p /opt/cni/bin && \
mkdir -p /usr/libexec/cni/ && \
cp go-controller/_output/go/bin/ovnkube /usr/bin/ && \
cp go-controller/_output/go/bin/ovn-kube-util /usr/bin/ && \
cp go-controller/_output/go/bin/ovn-k8s-cni-overlay /usr/libexec/cni/ovn-k8s-cni-overlay && \
rm -rf go-controller
# ovnkube.sh is the entry point. This script examines environment
# variables to direct operation and configure ovn
COPY dist/images/ovnkube.sh /root/
COPY dist/images/ovn-debug.sh /root/
# override the rpm's ovn_k8s.conf with this local copy
COPY dist/images/ovn_k8s.conf /etc/openvswitch/ovn_k8s.conf
LABEL io.k8s.display-name="ovn kubernetes" \
io.k8s.description="This is a component of OpenShift Container Platform that provides an overlay network using ovn." \
io.openshift.tags="openshift" \
maintainer="Phil Cameron <[email protected]>"
WORKDIR /root
ENTRYPOINT /root/ovnkube.sh