FROM openshift/golang-builder:1.12 AS builder
ENV OS_GIT_MAJOR=4 OS_GIT_MINOR=2 OS_GIT_PATCH=24 OS_GIT_VERSION=4.2.24-202003161048-9c8727e OS_GIT_TREE_STATE=clean SOURCE_GIT_COMMIT=9c8727eabe00f770614b7213b54d8828b05dc49e SOURCE_GIT_TAG=9c8727ea SOURCE_GIT_URL=https://github.com/openshift/cluster-kube-apiserver-operator SOURCE_DATE_EPOCH=1582164190 OS_GIT_COMMIT=9c8727e BUILD_VERSION=v4.2.24 BUILD_RELEASE=202003161048
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.24.20200316.104823
ENV OS_GIT_MAJOR=4 OS_GIT_MINOR=2 OS_GIT_PATCH=24 OS_GIT_VERSION=4.2.24-202003161048-9c8727e OS_GIT_TREE_STATE=clean SOURCE_GIT_COMMIT=9c8727eabe00f770614b7213b54d8828b05dc49e SOURCE_GIT_TAG=9c8727ea SOURCE_GIT_URL=https://github.com/openshift/cluster-kube-apiserver-operator SOURCE_DATE_EPOCH=1582164190 OS_GIT_COMMIT=9c8727e BUILD_VERSION=v4.2.24 BUILD_RELEASE=202003161048
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.24" \
        release="202003161048" \
        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"

