blob: 3f99847f52f06ef3fe23db1e4d8703f0e08023b5 [file] [log] [blame]
Mohammed Naserda994232024-04-13 12:34:01 -04001# Copyright (c) 2024 VEXXHOST, Inc.
2#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may
4# not use this file except in compliance with the License. You may obtain
5# a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations
13# under the License.
14
15FROM golang:1.20 AS ovn-kubernetes
16ARG OVN_KUBERNETES_REF=cbff639b83af00e4887b540fc06b880108662780
17ADD https://github.com/ovn-org/ovn-kubernetes.git#${OVN_KUBERNETES_REF} /src
18COPY patches/ovn-kubernetes /patches/ovn-kubernetes
19RUN git -C /src apply --verbose /patches/ovn-kubernetes/*
20RUN <<EOF bash -xe
21cd /src/go-controller
22go build -o /usr/bin/ovn-kube-util ./cmd/ovn-kube-util
23EOF
24
25FROM registry.atmosphere.dev/library/openvswitch:main
26ADD --chmod=755 https://dl.k8s.io/release/v1.29.3/bin/linux/amd64/kubectl /usr/local/bin/kubectl
27ARG OVN_SERIES=23.03
28ARG OVN_VERSION=${OVN_SERIES}.0-69
29RUN <<EOF sh -xe
30dnf -y --setopt=install_weak_deps=False --setopt=tsflags=nodocs install \
31 firewalld-filesystem hostname ovn${OVN_SERIES}-${OVN_VERSION}.el9s procps-ng
32dnf -y clean all
33rm -rf /var/cache/dnf
34EOF
35ARG OVN_COMPONENT
36RUN <<EOF sh -xe
37dnf -y --setopt=install_weak_deps=False --setopt=tsflags=nodocs install \
38 ovn${OVN_SERIES}-${OVN_COMPONENT}-${OVN_VERSION}.el9s
39dnf -y clean all
40rm -rf /var/cache/dnf
41EOF
42COPY --from=ovn-kubernetes --link /src/dist/images/ovndb-raft-functions.sh /root/ovndb-raft-functions.sh
43COPY --from=ovn-kubernetes --link /src/dist/images/ovnkube.sh /root/ovnkube.sh
44COPY --from=ovn-kubernetes --link /usr/bin/ovn-kube-util /usr/bin/ovn-kube-util