FROM openshift/golang-builder@sha256:4820580c3368f320581eb9e32cf97aeec179a86c5749753a14ed76410a293d83 AS builder
ENV __doozer=update BUILD_RELEASE=202202160023.p0.g5ad78fc.assembly.stream BUILD_VERSION=v4.10.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=10 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.10.0-202202160023.p0.g5ad78fc.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=5ad78fc OS_GIT_VERSION=4.10.0-202202160023.p0.g5ad78fc.assembly.stream-5ad78fc SOURCE_DATE_EPOCH=1642769728 SOURCE_GIT_COMMIT=5ad78fc5acb4892eb984d924b86ac2cf2e7057a0 SOURCE_GIT_TAG=atomic-openshift-descheduler-4.0.0-0.100.0-896-g5ad78fc5a SOURCE_GIT_URL=https://github.com/openshift/descheduler 
WORKDIR /go/src/sigs.k8s.io/descheduler
COPY . .
ARG prefix=sigs.k8s.io/descheduler/pkg/version
RUN go build -ldflags "-X ${prefix}.version=${OS_GIT_VERSION} -X ${prefix}.buildDate=${BUILD_RELEASE} -X ${prefix}.gitsha1=${SOURCE_GIT_COMMIT}" -o descheduler ./cmd/descheduler

FROM openshift/base-rhel8:v4.10.0.20220216.010142
ENV __doozer=update BUILD_RELEASE=202202160023.p0.g5ad78fc.assembly.stream BUILD_VERSION=v4.10.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=10 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.10.0-202202160023.p0.g5ad78fc.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=5ad78fc OS_GIT_VERSION=4.10.0-202202160023.p0.g5ad78fc.assembly.stream-5ad78fc SOURCE_DATE_EPOCH=1642769728 SOURCE_GIT_COMMIT=5ad78fc5acb4892eb984d924b86ac2cf2e7057a0 SOURCE_GIT_TAG=atomic-openshift-descheduler-4.0.0-0.100.0-896-g5ad78fc5a SOURCE_GIT_URL=https://github.com/openshift/descheduler 
COPY --from=builder /go/src/sigs.k8s.io/descheduler/descheduler /usr/bin/
CMD ["/usr/bin/descheduler"]

LABEL \
        License="GPLv2+" \
        io.k8s.description="Descheduler for Opensift and Kubernetes" \
        io.k8s.display-name="Descheduler" \
        io.openshift.tags="openshift,descheduler" \
        vendor="Red Hat" \
        name="openshift/ose-descheduler" \
        com.redhat.component="atomic-openshift-descheduler-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        io.openshift.maintainer.component="kube-scheduler" \
        release="202202160023.p0.g5ad78fc.assembly.stream" \
        io.openshift.build.commit.id="5ad78fc5acb4892eb984d924b86ac2cf2e7057a0" \
        io.openshift.build.source-location="https://github.com/openshift/descheduler" \
        io.openshift.build.commit.url="https://github.com/openshift/descheduler/commit/5ad78fc5acb4892eb984d924b86ac2cf2e7057a0" \
        version="v4.10.0"

