FROM openshift/golang-builder:1.12 AS builder
ENV __doozer=update BUILD_RELEASE=202005252115 BUILD_VERSION=v4.2.34 OS_GIT_MAJOR=4 OS_GIT_MINOR=2 OS_GIT_PATCH=34 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.2.34-202005252115 
ENV __doozer=merge OS_GIT_COMMIT=673e989 OS_GIT_VERSION=4.2.34-202005252115-673e989 SOURCE_DATE_EPOCH=1589421305 SOURCE_GIT_COMMIT=673e989efe5a66549afcdc7980e61d18e5b68b1c SOURCE_GIT_TAG=673e989e SOURCE_GIT_URL=https://github.com/openshift/sdn 
WORKDIR /go/src/github.com/openshift/sdn
COPY . .
RUN make build --warn-undefined-variables

FROM openshift/ose-base:v4.2.34.20200525.211548
ENV __doozer=update BUILD_RELEASE=202005252115 BUILD_VERSION=v4.2.34 OS_GIT_MAJOR=4 OS_GIT_MINOR=2 OS_GIT_PATCH=34 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.2.34-202005252115 
ENV __doozer=merge OS_GIT_COMMIT=673e989 OS_GIT_VERSION=4.2.34-202005252115-673e989 SOURCE_DATE_EPOCH=1589421305 SOURCE_GIT_COMMIT=673e989efe5a66549afcdc7980e61d18e5b68b1c SOURCE_GIT_TAG=673e989e SOURCE_GIT_URL=https://github.com/openshift/sdn 
RUN INSTALL_PKGS="conntrack-tools" && \
    yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
    yum clean all && rm -rf /var/cache/*

COPY --from=builder /go/src/github.com/openshift/sdn/kube-proxy /usr/bin/
COPY ./images/iptables-scripts/iptables /usr/sbin/
COPY ./images/iptables-scripts/iptables-save /usr/sbin/
COPY ./images/iptables-scripts/iptables-restore /usr/sbin/
COPY ./images/iptables-scripts/ip6tables /usr/sbin/
COPY ./images/iptables-scripts/ip6tables-save /usr/sbin/
COPY ./images/iptables-scripts/ip6tables-restore /usr/sbin/

LABEL \
        io.k8s.display-name="Kubernetes kube-proxy" \
        io.k8s.description="Provides kube-proxy for external CNI plugins" \
        io.openshift.tags="openshift,kube-proxy" \
        name="openshift/ose-kube-proxy" \
        com.redhat.component="kube-proxy-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        io.openshift.maintainer.component="Networking" \
        io.openshift.maintainer.subcomponent="openshift-sdn" \
        version="v4.2.34" \
        release="202005252115" \
        io.openshift.build.commit.id="673e989efe5a66549afcdc7980e61d18e5b68b1c" \
        io.openshift.build.source-location="https://github.com/openshift/sdn" \
        io.openshift.build.commit.url="https://github.com/openshift/sdn/commit/673e989efe5a66549afcdc7980e61d18e5b68b1c"

