FROM openshift/golang-builder:rhel_8_golang_1.16 AS builder
ENV __doozer=update BUILD_RELEASE=202110182323.p0.git.083d37c.assembly.stream BUILD_VERSION=v4.9.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=9 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.9.0-202110182323.p0.git.083d37c.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=083d37c OS_GIT_VERSION=4.9.0-202110182323.p0.git.083d37c.assembly.stream-083d37c SOURCE_DATE_EPOCH=1629397006 SOURCE_GIT_COMMIT=083d37c46a91d14762ad80c0ee8b6db40a3eb4bf SOURCE_GIT_TAG=083d37c4 SOURCE_GIT_URL=https://github.com/openshift/cluster-dns-operator 
WORKDIR /dns-operator
COPY . .
RUN make build

FROM openshift/ose-base:v4.9.0.20211018.233142
ENV __doozer=update BUILD_RELEASE=202110182323.p0.git.083d37c.assembly.stream BUILD_VERSION=v4.9.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=9 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.9.0-202110182323.p0.git.083d37c.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=083d37c OS_GIT_VERSION=4.9.0-202110182323.p0.git.083d37c.assembly.stream-083d37c SOURCE_DATE_EPOCH=1629397006 SOURCE_GIT_COMMIT=083d37c46a91d14762ad80c0ee8b6db40a3eb4bf SOURCE_GIT_TAG=083d37c4 SOURCE_GIT_URL=https://github.com/openshift/cluster-dns-operator 
COPY --from=builder /dns-operator/dns-operator /usr/bin/
COPY manifests /manifests
RUN useradd dns-operator
USER dns-operator
ENTRYPOINT ["/usr/bin/dns-operator"]

LABEL \
        io.openshift.release.operator="true" \
        io.k8s.display-name="OpenShift dns-operator" \
        io.k8s.description="This is a component of OpenShift and manages the lifecycle of cluster DNS services." \
        maintainer="Dan Mace <dmace@redhat.com>" \
        name="openshift/ose-cluster-dns-operator" \
        com.redhat.component="ose-cluster-dns-operator-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        io.openshift.maintainer.component="DNS" \
        release="202110182323.p0.git.083d37c.assembly.stream" \
        io.openshift.build.commit.id="083d37c46a91d14762ad80c0ee8b6db40a3eb4bf" \
        io.openshift.build.source-location="https://github.com/openshift/cluster-dns-operator" \
        io.openshift.build.commit.url="https://github.com/openshift/cluster-dns-operator/commit/083d37c46a91d14762ad80c0ee8b6db40a3eb4bf" \
        version="v4.9.0"

