-
Notifications
You must be signed in to change notification settings - Fork 142
/
Dockerfile.base
50 lines (42 loc) · 2.14 KB
/
Dockerfile.base
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
#
# 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-kubernetes-base
# build base image shared by both OpenShift and MicroShift
FROM registry.ci.openshift.org/ocp/4.17:base-rhel9
# install selinux-policy first to avoid a race
RUN dnf --setopt=retries=2 --setopt=timeout=2 install -y --nodocs \
selinux-policy procps-ng && \
dnf clean all
ARG ovsver=3.4.0-18.el9fdp
ARG ovnver=24.09.0-33.el9fdp
# NOTE: Ensure that the versions of OVS and OVN are overriden for OKD in each of the subsequent layers.
# Centos and RHEL releases for ovn are built out of sync, so please make sure to bump for OKD with
# the corresponding Centos version when updating the OCP version.
ARG ovsver_okd=3.4.0-12.el9s
ARG ovnver_okd=24.09.0-41.el9s
RUN INSTALL_PKGS="iptables nftables" && \
source /etc/os-release && \
[ "${ID}" == "centos" ] && ovsver=$ovsver_okd && ovnver=$ovnver_okd; \
ovsver_short=$(echo "$ovsver" | cut -d'.' -f1,2) && \
ovnver_short=$(echo "$ovnver" | cut -d'.' -f1,2) && \
dnf --setopt=retries=2 --setopt=timeout=2 install -y --nodocs $INSTALL_PKGS && \
dnf --setopt=retries=2 --setopt=timeout=2 install -y --nodocs "openvswitch$ovsver_short = $ovsver" "python3-openvswitch$ovsver_short = $ovsver" && \
dnf --setopt=retries=2 --setopt=timeout=2 install -y --nodocs "ovn$ovnver_short = $ovnver" "ovn$ovnver_short-central = $ovnver" "ovn$ovnver_short-host = $ovnver" && \
dnf clean all && rm -rf /var/cache/* && \
sed 's/%/"/g' <<<"%openvswitch$ovsver_short-devel = $ovsver% %openvswitch$ovsver_short-ipsec = $ovsver% %ovn$ovnver_short-vtep = $ovnver%" > /more-pkgs
RUN mkdir -p /var/run/openvswitch && \
mkdir -p /var/run/ovn && \
mkdir -p /etc/cni/net.d && \
mkdir -p /opt/cni/bin && \
mkdir -p /usr/libexec/cni/ && \
mkdir -p /root/windows/
# copy git commit number into image
COPY .git/HEAD /root/.git/HEAD
COPY .git/refs/heads/ /root/.git/refs/heads/
# ovnkube.sh is the entry point. This script examines environment
# variables to direct operation and configure ovn
COPY dist/images/ovnkube.sh /root/
WORKDIR /root
ENTRYPOINT /root/ovnkube.sh