#
# This is the egress router L4 DNS proxy for OpenShift Origin
#
# The standard name for this image is openshift/origin-egress-dns-proxy
FROM registry.fedoraproject.org/f29/origin-base:latest

ENV NAME=origin-egress-dns-proxy \
    VERSION=3.11 \
    ARCH=x86_64

# HAProxy 1.6+ version is needed to leverage DNS resolution at runtime.
RUN INSTALL_PKGS="haproxy rsyslog" && \
    dnf install -y $INSTALL_PKGS && \
    rpm -V $INSTALL_PKGS && \
    dnf clean all && \
    mkdir -p /var/lib/haproxy/{run,log} && \
    mkdir -p /etc/haproxy && \
    setcap 'cap_net_bind_service=ep' /usr/sbin/haproxy && \
    chown -R :0 /var/lib/haproxy && \
    chmod -R g+w /var/lib/haproxy && \
    touch /etc/haproxy/haproxy.cfg

LABEL io.k8s.display-name="OpenShift Origin L4 DNS proxy egress router" \
      io.k8s.description="This is the egress router L4 DNS proxy for OpenShift Origin" \
      io.openshift.tags="openshift,router,egress,dns" \
      summary="This is the egress router L4 DNS proxy for OpenShift Origin" \
      maintainer="Jakub Cajka <jcajka@fedoraproject.org>" \
      License="GPLv2+" \
      name="$FGC/$NAME" \
      com.redhat.component="$NAME" \
      version="$VERSION" \
      architecture="$ARCH" \
      usage="This is the egress router L4 DNS proxy for OpenShift Origin"

ADD egress-dns-proxy.sh /bin/egress-dns-proxy.sh

ENTRYPOINT /bin/egress-dns-proxy.sh


