FROM openshift/golang-builder:1.12 AS builder
ENV __doozer=update BUILD_RELEASE=202006160135 BUILD_VERSION=v4.3.26 OS_GIT_MAJOR=4 OS_GIT_MINOR=3 OS_GIT_PATCH=26 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.3.26-202006160135 
ENV __doozer=merge OS_GIT_COMMIT=730b8fc OS_GIT_VERSION=4.3.26-202006160135-730b8fc SOURCE_DATE_EPOCH=1590603349 SOURCE_GIT_COMMIT=730b8fcce00871cfe56b948a1aaf23fbf4c45ff7 SOURCE_GIT_TAG=730b8fcc SOURCE_GIT_URL=https://github.com/openshift/console-operator 
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.3.26.20200616.013506
ENV __doozer=update BUILD_RELEASE=202006160135 BUILD_VERSION=v4.3.26 OS_GIT_MAJOR=4 OS_GIT_MINOR=3 OS_GIT_PATCH=26 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.3.26-202006160135 
ENV __doozer=merge OS_GIT_COMMIT=730b8fc OS_GIT_VERSION=4.3.26-202006160135-730b8fc SOURCE_DATE_EPOCH=1590603349 SOURCE_GIT_COMMIT=730b8fcce00871cfe56b948a1aaf23fbf4c45ff7 SOURCE_GIT_TAG=730b8fcc SOURCE_GIT_URL=https://github.com/openshift/console-operator 
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/

# extensions manifests generated from openshift/api types
COPY vendor/github.com/openshift/api/console/v1/*.yaml /manifests/
COPY vendor/github.com/openshift/api/operator/v1/0000_70_console-operator.crd.yaml /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" \
        io.openshift.maintainer.component="Management Console" \
        version="v4.3.26" \
        release="202006160135" \
        io.openshift.build.commit.id="730b8fcce00871cfe56b948a1aaf23fbf4c45ff7" \
        io.openshift.build.source-location="https://github.com/openshift/console-operator" \
        io.openshift.build.commit.url="https://github.com/openshift/console-operator/commit/730b8fcce00871cfe56b948a1aaf23fbf4c45ff7"

