FROM openshift/golang-builder:1.12 AS builder
ENV OS_GIT_MAJOR=4 OS_GIT_MINOR=2 OS_GIT_PATCH=28 OS_GIT_VERSION=4.2.28-202004061218-c7f433d OS_GIT_TREE_STATE=clean SOURCE_GIT_COMMIT=c7f433dbe8da9750b119cfad367d51f127baf826 SOURCE_GIT_TAG=c7f433db SOURCE_GIT_URL=https://github.com/openshift/console-operator SOURCE_DATE_EPOCH=1575949746 OS_GIT_COMMIT=c7f433d BUILD_VERSION=v4.2.28 BUILD_RELEASE=202004061218
WORKDIR /go/src/github.com/openshift/console-operator
COPY . .
RUN ADDITIONAL_GOTAGS="ocp" make build WHAT="cmd/console"; \
    mkdir -p /tmp/build; \
    cp /go/src/github.com/openshift/console-operator/_output/local/bin/linux/$(go env GOARCH)/console /tmp/build/console

FROM openshift/ose-base:v4.2.28.20200406.121827
ENV OS_GIT_MAJOR=4 OS_GIT_MINOR=2 OS_GIT_PATCH=28 OS_GIT_VERSION=4.2.28-202004061218-c7f433d OS_GIT_TREE_STATE=clean SOURCE_GIT_COMMIT=c7f433dbe8da9750b119cfad367d51f127baf826 SOURCE_GIT_TAG=c7f433db SOURCE_GIT_URL=https://github.com/openshift/console-operator SOURCE_DATE_EPOCH=1575949746 OS_GIT_COMMIT=c7f433d BUILD_VERSION=v4.2.28 BUILD_RELEASE=202004061218
RUN useradd console-operator
USER console-operator
COPY --from=builder /tmp/build/console /usr/bin/console

# these manifests are necessary for the installer
COPY manifests /manifests/



# entrypoint specified in 03-operator.yaml as `console-operator`
# CMD ["/usr/bin/console", "operator", "--kubeconfig", "path/to/config", "--config", "./install/config.yaml", "--v", "4"]
# CMD ["/usr/bin/console", "operator", "--v", "4"]

LABEL \
        io.k8s.display-name="OpenShift console-operator" \
        io.k8s.description="This is a component of OpenShift Container Platform and manages the lifecycle of the web console." \
        io.openshift.tags="openshift" \
        maintainer="Benjamin A. Petersen <bpetersen@redhat.com>" \
        io.openshift.release.operator="true" \
        name="openshift/ose-console-operator" \
        com.redhat.component="openshift-enterprise-console-operator-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        version="v4.2.28" \
        release="202004061218" \
        io.openshift.build.commit.id="c7f433dbe8da9750b119cfad367d51f127baf826" \
        io.openshift.build.source-location="https://github.com/openshift/console-operator" \
        io.openshift.build.commit.url="https://github.com/openshift/console-operator/commit/c7f433dbe8da9750b119cfad367d51f127baf826"

