FROM openshift/golang-builder:1.12 AS builder
ENV SOURCE_GIT_COMMIT=51569b24b4a92d6d8df2020c2e8e2866c5e78266 SOURCE_DATE_EPOCH=1562784015 BUILD_VERSION=v4.2.0 SOURCE_GIT_URL=https://github.com/openshift/coredns SOURCE_GIT_TAG=v3.11.0-106-g51569b24 BUILD_RELEASE=201910101614
WORKDIR /go/src/github.com/coredns/coredns
COPY . .
RUN GO111MODULE=on GOFLAGS=-mod=vendor go build -o coredns .

FROM openshift/ose-base:v4.2.0.20191010.161456
ENV SOURCE_GIT_COMMIT=51569b24b4a92d6d8df2020c2e8e2866c5e78266 SOURCE_DATE_EPOCH=1562784015 BUILD_VERSION=v4.2.0 SOURCE_GIT_URL=https://github.com/openshift/coredns SOURCE_GIT_TAG=v3.11.0-106-g51569b24 BUILD_RELEASE=201910101614
COPY --from=builder /go/src/github.com/coredns/coredns/coredns /usr/bin/

ENTRYPOINT ["/usr/bin/coredns"]

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

