FROM openshift/golang-builder:1.12 AS builder
ENV OS_GIT_MAJOR=4 OS_GIT_MINOR=2 OS_GIT_PATCH=23 OS_GIT_VERSION=4.2.23-202003090920-51569b2 OS_GIT_TREE_STATE=clean SOURCE_GIT_COMMIT=51569b24b4a92d6d8df2020c2e8e2866c5e78266 SOURCE_GIT_TAG=v3.11.0-106-g51569b24 SOURCE_GIT_URL=https://github.com/openshift/coredns SOURCE_DATE_EPOCH=1562784015 OS_GIT_COMMIT=51569b2 BUILD_VERSION=v4.2.23 BUILD_RELEASE=202003090920
WORKDIR /go/src/github.com/coredns/coredns
COPY . .
RUN GO111MODULE=on GOFLAGS=-mod=vendor go build -o coredns .

FROM openshift/ose-base:v4.2.23.20200309.092017
ENV OS_GIT_MAJOR=4 OS_GIT_MINOR=2 OS_GIT_PATCH=23 OS_GIT_VERSION=4.2.23-202003090920-51569b2 OS_GIT_TREE_STATE=clean SOURCE_GIT_COMMIT=51569b24b4a92d6d8df2020c2e8e2866c5e78266 SOURCE_GIT_TAG=v3.11.0-106-g51569b24 SOURCE_GIT_URL=https://github.com/openshift/coredns SOURCE_DATE_EPOCH=1562784015 OS_GIT_COMMIT=51569b2 BUILD_VERSION=v4.2.23 BUILD_RELEASE=202003090920
COPY --from=builder /go/src/github.com/coredns/coredns/coredns /usr/bin/

ENTRYPOINT ["/usr/bin/coredns"]

LABEL \
        io.k8s.display-name="CoreDNS" \
        io.k8s.description="CoreDNS delivers the DNS and Discovery Service for a Kubernetes cluster." \
        maintainer="dev@lists.openshift.redhat.com" \
        name="openshift/ose-coredns" \
        com.redhat.component="coredns-container" \
        version="v4.2.23" \
        release="202003090920" \
        io.openshift.build.commit.id="51569b24b4a92d6d8df2020c2e8e2866c5e78266" \
        io.openshift.build.source-location="https://github.com/openshift/coredns" \
        io.openshift.build.commit.url="https://github.com/openshift/coredns/commit/51569b24b4a92d6d8df2020c2e8e2866c5e78266"

