FROM openshift/golang-builder:1.12 AS builder
ENV SOURCE_GIT_COMMIT=9c8727eabe00f770614b7213b54d8828b05dc49e SOURCE_GIT_TAG=9c8727ea SOURCE_GIT_URL=https://github.com/openshift/cluster-kube-apiserver-operator SOURCE_DATE_EPOCH=1582164190 BUILD_VERSION=v4.2.21 BUILD_RELEASE=202002240343
WORKDIR /go/src/github.com/openshift/cluster-kube-apiserver-operator
COPY . .
ENV GO_PACKAGE github.com/openshift/cluster-kube-apiserver-operator
RUN go build -ldflags "-X $GO_PACKAGE/pkg/version.versionFromGit=$(git describe --long --tags --abbrev=7 --match 'v[0-9]*')" ./cmd/cluster-kube-apiserver-operator

FROM openshift/ose-base:v4.2.21.20200224.034357
ENV SOURCE_GIT_COMMIT=9c8727eabe00f770614b7213b54d8828b05dc49e SOURCE_GIT_TAG=9c8727ea SOURCE_GIT_URL=https://github.com/openshift/cluster-kube-apiserver-operator SOURCE_DATE_EPOCH=1582164190 BUILD_VERSION=v4.2.21 BUILD_RELEASE=202002240343
RUN mkdir -p /usr/share/bootkube/manifests
COPY --from=builder /go/src/github.com/openshift/cluster-kube-apiserver-operator/bindata/bootkube/* /usr/share/bootkube/manifests/
COPY --from=builder /go/src/github.com/openshift/cluster-kube-apiserver-operator/cluster-kube-apiserver-operator /usr/bin/
COPY manifests/*.yaml /manifests
COPY manifests/image-references /manifests
# FIXME: entrypoint shouldn't be bash but the binary (needs fixing the chain)
# ENTRYPOINT ["/usr/bin/cluster-kube-apiserver-operator"]

LABEL \
        io.openshift.release.operator="true" \
        name="openshift/ose-cluster-kube-apiserver-operator" \
        com.redhat.component="ose-cluster-kube-apiserver-operator-container" \
        version="v4.2.21" \
        release="202002240343" \
        io.openshift.build.commit.id="9c8727eabe00f770614b7213b54d8828b05dc49e" \
        io.openshift.build.source-location="https://github.com/openshift/cluster-kube-apiserver-operator" \
        io.openshift.build.commit.url="https://github.com/openshift/cluster-kube-apiserver-operator/commit/9c8727eabe00f770614b7213b54d8828b05dc49e"

