#
# This is the OpenShift FRR network image.
#
# The standard name for this image is frr
#

FROM openshift/base-rhel8:v4.10.0.20220308.182903
ENV __doozer=update BUILD_RELEASE=202203081809.p0.ge996d07.assembly.stream BUILD_VERSION=v4.10.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=10 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.10.0-202203081809.p0.ge996d07.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=e996d07 OS_GIT_VERSION=4.10.0-202203081809.p0.ge996d07.assembly.stream-e996d07 SOURCE_DATE_EPOCH=1638811403 SOURCE_GIT_COMMIT=e996d07e241355a0a706a60def326ac5f13c42ac SOURCE_GIT_TAG=e996d07 SOURCE_GIT_URL=https://github.com/openshift/frr 
USER root

ENV PYTHONDONTWRITEBYTECODE yes

RUN INSTALL_PKGS=" \
	tcpdump libpcap \
	iproute iputils strace socat \
	frr \
	python3 \
        tini \
        " && \
	yum install -y --setopt=tsflags=nodocs --setopt=skip_missing_names_on_install=False $INSTALL_PKGS

RUN dnf -y update && yum clean all && rm -rf /var/cache/yum/* && rm -rf /var/cache/yum

# frr.sh is the entry point. This script examines environment
# variables to direct operation and configure ovn
ADD frr.sh /root/
ADD daemons /etc/frr
ADD frr.conf /etc/frr
ADD vtysh.conf /etc/frr

RUN chown frr:frr /etc/frr/daemons /etc/frr/frr.conf
RUN ln -s /usr/bin/tini /sbin/tini

WORKDIR /root
ENTRYPOINT ["/sbin/tini", "--"]

COPY docker-start /usr/lib/frr/docker-start
CMD ["/usr/lib/frr/docker-start"]

LABEL \
        name="openshift/frr-rhel8" \
        com.redhat.component="ose-frr-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        io.openshift.maintainer.component="Networking" \
        io.openshift.maintainer.subcomponent="frr" \
        release="202203081809.p0.ge996d07.assembly.stream" \
        io.openshift.build.commit.id="e996d07e241355a0a706a60def326ac5f13c42ac" \
        io.openshift.build.source-location="https://github.com/openshift/frr" \
        io.openshift.build.commit.url="https://github.com/openshift/frr/commit/e996d07e241355a0a706a60def326ac5f13c42ac" \
        version="v4.10.0"

